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

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

1.变量命名

(1)成员变量

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

例如:

_curValue;

_oldValue;

_curValue;

_minValue;

(2)全局变量

在变量名前加g_

g_curValue

(3)静态变量

static int s_initValue;

2.函数命名

void SetValue();

void GetValue();

posted @ 2019-04-13 11:37  jainss  阅读(5759)  评论(0编辑  收藏  举报