1.基本概念
(1)条件编译的行为类似于C语言中的 if…else…
(2)条件编译是预编译指示命令,用于控制是否编译某段代码
如test.c
// #include <stdio.h>
#define C 1
int main()
{
const char* s;
#if( C == 1 )
s = "This is first printf...\n";
#else
s = "This is second printf...\n";
#endif
// printf("%s", s);
return 0;
}
单步运行:gcc -E test.c -o test.i
得到的test.i文件主函数中,删除了#if,#else,#endif,
保留了