//
// main.c
// C语言学习
#include <stdio.h>
#define SCORE 100
#define COUNT 50
int main(int argc, const char * argv[]) {
#ifdef SCORE //判断是否定义了后面的宏
printf("score\n");
#else COUNT
printf("count\n");
#endif
//
#ifndef SCORE //判断是否没有定义名称叫做SCORE的宏
printf("not");
#endif
return 0;
}
条件编译的其他用法
最新推荐文章于 2024-01-06 15:33:43 发布