样例程序如下:
需要调试时,在文件开头加上 #define DEBUG
不需要调试时,去掉文件开头的 #define DEBUG
#include <stdio.h>
#include <string.h>
#define DEBUG 1
int main(){
printf("%.3d\n",9);
#ifdef DEBUG
printf("Debug : ================== \n") ;
#endif
#if DEBUG == 0
printf("DEBUG == 0\n");
#elif DEBUG == 1
printf("DEBUG == 1\n");
#else
printf("DEBUG == x\n");
#endif
return 0 ;
}