sns网站建设哪家公司好,做空山寨币的网站,南昌网站建设费用,个人定做衣服店c语言 宏定义 去除宏定义To check whether a Macro is defined or not in C language – we use #ifdef preprocessor directive, it is used to check Macros only. 要检查是否用C语言定义了宏 -我们使用#ifdef预处理程序指令#xff0c;它仅用于检查宏。 Syntax: 句法…c语言 宏定义 去除宏定义To check whether a Macro is defined or not in C language – we use #ifdef preprocessor directive, it is used to check Macros only. 要检查是否用C语言定义了宏 -我们使用#ifdef预处理程序指令它仅用于检查宏。 Syntax: 句法 #ifdef MACRO_NAME
//body
#endif
If MACRO_NAME is defined, then the compiler will compile //body (a set of statements written within the #ifdef ... #endif block). 如果定义了MACRO_NAME 则编译器将编译// body (在#ifdef ... #endif块中编写的一组语句)。 Example: 例 #include stdio.h
#define NUM 100
int main()
{
//checking a defined Macro
#ifdef NUM
printf(Macro NUM is defined, and its value is %d\n,NUM);
#else
printf(Macro NUM is not defined\n);
#endif
//checking an undefined Macro
#ifdef MAX
printf(Macro MAX is defined, and its value is %d\n,MAX);
#else
printf(Macro MAX is not defined\n);
#endif
return 0;
}
Output 输出量 Macro NUM is defined, and its value is 100Macro MAX is not defined翻译自: https://www.includehelp.com/c-programs/check-whether-a-macro-is-defined-or-not-in-c.aspxc语言 宏定义 去除宏定义