1.各种类型、函数、类的命名规范举例:
int32_t i32PosX; //或者 int nPosX
int16_t i16PosX;
int8_t i8PosX;
uint32_t u32PosX;
uint16_t u16PosX;
uint8_t u8PosX;
float sScale;
double dValue;
char cName;
char szName[32];
string strInfo;
bool bPass;
int32_t *pValue; //指针
int32_t arrName[32];//数组
vector<int> vecValue;//容器
list<double> lstInfo;//列表
int32_t m_i32Age; //成员变量
int32_t g_i32Age; //全局变量
typedef enum
{
ABS_unavailable = 0,
ABS_off = 1,
ABS_on = 2,
ABS_engaged = 3
}Abs_e;
Abs_e emWeek; //枚举
typedef struct
{
int32_t i32Data;
}Node_t,*pNode_t;
Node_t tNode; //结构体
InfoNode_t tMyInfo;
class CStudent //类的定义
{
...
};
C++编程命名规范的举例
最新推荐文章于 2024-07-29 09:10:44 发布