1. #defines and const

test.h

#ifndef TEST_H
#define TEST_H
#endif
#define FALSE 0
#define TRUE (!FALSE)
#define MAX_NO_OF_STUDENT 100
const int MAX_NO_OF_STUDENT = 100;

2.Function(函数)

int m_iGetValues();
m_ : a member of a class
i : returns a int
long m_lGetValues();
m_ : a member of a class
l : returns a long
int * m_piGetValus();
m_ : a member of a class
p : returns pointer
i : a int pointer
void * m_pvDoSomething();
m_ : a member of a class
p : returns pointer
v : a void pointer
unsigned char ucGetValues();
uc : This returns unsigned char
bool bIsRunning();
b : returns a bool
void m_vSetValues(int iNum);
m_ : a member of a class
v : there is no return value

If the function is not a member of a class, then 'm_' prefix is not used.Example:

//global function
int g_iGetValues();
g_ : a global functions
i : returns a int

3.Variables(变量)

//在 int变量 的最前面加上一个小写的i,之后每个单词的第一个字母大写
int iNum;
int iNoOfVariables;
//在数组的最前面加上a(array),然后紧接着一个数组类型的字母。
char acFileName[128]; ac代表一个字符类型的数组
int aiNum[128]; ai代表这是一个int类型的数组
char *apcFileName[128]; 这是一个数组,数组中保存着128个char类型的指针
char (*pacFileName)[128]; 这是一个指针,
//在变量的最前面加上 m_, 代表这是一个类或者是一个结构体中的成员变量。
typedef struct _SNode {
char * m_pcName; //m_:结构体成员; pc:指向char类型的指针
struct _SNode * m_pstNext; //m_结构体成员; pst:指向struct类型的指针
}SNode;

4.总结

具体代码参考链接:http://mdgsf.xyz/?p=31

最新文章

  1. 移动端自适应:flexible.js可伸缩布局使用
  2. WPF国际化(多语言)
  3. LoadRunner 文本检查点使用
  4. js与flash结合使用
  5. Qt-获取主机网络信息之QHostAddress
  6. Problem K: Yikes -- Bikes!
  7. validate大表单验证
  8. PHP 防恶意刷新实现代码
  9. 第二十八条:利用有限制通配符来提升API的灵活性
  10. 移动端1px问题处理方法
  11. 生成3位的序列号_仅仅CASE WHEN的简单应用
  12. IDEA整合Junit详细步骤
  13. 洛谷P3380 【模板】二逼平衡树(树套树,树状数组,线段树)
  14. OpenLdap+MySQL笔记
  15. 标签a点击以后,5秒内禁止点击,5秒后激活
  16. html概括
  17. 【转】Deep Learning(深度学习)学习笔记整理系列之(八)
  18. Google 推出新搜索引擎以查找数据集
  19. 定制LFS镜像及安装过程
  20. Oracle 10gR2 RAC 启动与关闭

热门文章

  1. Windows离线安装.NET3.X
  2. canvas toDataUrl 跨域问题
  3. SVN版本日志对话框命令使用指南
  4. SqlServer数据库设计,纠结的问题,有胆你就来!
  5. nginx环境下搭建nagios 3.5.0,及配置pnp4nagios画图
  6. VC Windows系统服务创建代码
  7. JDK1.5新特性随手记
  8. 新安装ubuntu后几项配置
  9. 不在界面上用控件 动态创建idhttp,IdAntiFreeze来用
  10. python命令行运行在win和Linux系统的不同