/*
1)#if #elif #else #endif
2) #ifdef 用来判断某个宏定义
*/
#include <stdio.h>
#define DEBUG 1
int main(int argc, const char * argv[]) {
int a = 0;
#ifdef DEBUG
a = 10;
#else
a = 1000;
#endif
printf("%d\n",a);
#ifndef DEBUG1
a = 100;
#else
a = -1;
#endif
printf("%d\n",a);
return 0;
} |
|