C++函数和变量命名规则

最近一直纠结如何命名函数和变量名,于是搜索了相关命名内容

1.变量命名

(1)成员变量

在变量名前加上"_"表示

例如:

_curValue;

_oldValue;

_curValue;

_minValue;

(2)全局变量

在变量名前加g_

g_curValue

(3)静态变量

static int s_initValue;

2.函数命名

void SetValue();

void GetValue();

猜你喜欢

转载自www.cnblogs.com/jainszhang/p/10700440.html