C++中有两种静态变量: (1) 静态局部变量(static local variable),这种变量是在函数调用结束后不消失而保留原 值,即存储单元不释放,在下回调用时,该变量的保留上一次函数调用结束时的值。
基于16个网页-相关网页
local static variable 本地静态变量
This field will hold the value of the static local variable I in GetMessage.
此字段将在GetMessage中保留静态局部变量i的值。
You can declare a static local variable within a class, that is, inside a procedure in that class.
您可以初始化静态区域变数的值,当做宣告的一部分。
Given the runtime overhead in using a static local variable, it would be wise for you to avoid the feature in current designs.
由于运行库在使用静态局部变量时有开销,因此您最好避免在当前设计中使用该功能。
应用推荐