最近一直纠结如何命名函数和变量名,于是搜索了相关命名内容
1.变量命名
(1)成员变量
在变量名前加上"_"表示
例如:
_curValue;
_oldValue;
_curValue;
_minValue;
(2)全局变量
在变量名前加g_
g_curValue
(3)静态变量
static int s_initValue;
2.函数命名
void SetValue();
void GetValue();
最近一直纠结如何命名函数和变量名,于是搜索了相关命名内容
在变量名前加上"_"表示
例如:
_curValue;
_oldValue;
_curValue;
_minValue;
在变量名前加g_
g_curValue
static int s_initValue;
void SetValue();
void GetValue();
本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。