最近一直糾結如何命名函數和變量名,於是搜索了相關命名內容
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刪除。