/*
用来测试gcc -D -U的用法
-D,用来设置宏
-U,用来取消宏
*/
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char const* argv[])
{
#ifdef DEBUG
printf("debugging......./n");
#else
printf("no debugging......./n");
#endif
return 0;
}
本文通过一个简单的示例介绍了如何使用GCC编译器的预处理器指令-D和-U来定义和取消宏定义。这对于理解编译过程及调试模式的启用与禁用非常有用。
/*
用来测试gcc -D -U的用法
-D,用来设置宏
-U,用来取消宏
*/
#include <stdio.h>
#include <stdlib.h>
int main (int argc, char const* argv[])
{
#ifdef DEBUG
printf("debugging......./n");
#else
printf("no debugging......./n");
#endif
return 0;
}
1124
583

被折叠的 条评论
为什么被折叠?
