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;
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
//在 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;
具体代码参考连接:http://mdgsf.xyz/?p=31指针