作用:防止头文件的重复包含和编译 定义 #ifndef x #define x ... #endif 这是宏定义的一种,它可以根据是否已经定义了一个变量来进行分支选择,一般用于调试等等.实际上确切的说这应该是预处理功能中三种(宏定义,文件包含和条件编译)中的一种----条件编译. C语言在对程序进行编译时,会先根据预处理命令进行“预处理”.C语言编译系统包括预处理,编译和链接等部分. #ifndef x //先测试x是否被宏定义过 #define x //如果没有宏定义下面就宏定义x并编译下面的
Windows 常量定义在winuser.h中可以找到,如果了安装了visual studio 2010,winuser.h所在目录为C:\Program Files (x86)\Microsoft SDKs\Windows\v7.0A\Include /***************************************************************************** ** winuser.h -- USER procedure declarations,
The special operator defined is used in #if and #elif expressions to test whether a certain name is defined as a macro. defined name and defined (name) are both expressions whose value is 1 if name is defined as a macro at the current point in the pr