非静态函数可以在C ++中修改静态变量吗 [英] Can Non-static function modify a static variable in c++
本文介绍了非静态函数可以在C ++中修改静态变量吗的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
非静态函数可以在c ++中修改静态变量
can Non-static function modify a static variable in c++
推荐答案
是的,只要数据成员的可见性允许,非静态成员函数就可以修改静态数据成员.
Yes, a non-static member function can modify a static data member as long as the data member's visibility allows it.
这篇关于非静态函数可以在C ++中修改静态变量吗的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文