1 #include <stdio.h> 2 3 #define __DEBUG__ 4 5 #ifdef __DEBUG__ 6 #define DEBUG(format,...) printf("File: "__FILE__", Line: %05d: "format"\n", __LINE__, ##__VA_ARGS__) 7 #else 8 #define DEBUG(format,...) 9 #endif 10 11 int main(int argc, char **argv) { 12 char str[]="Hello World"; 13 DEBUG("A ha, check me: %s",str); 14 printf("File: "__FILE__", Line: %05d: A ha, check me: %s\n", __LINE__, str); 15 while(1); 16 return 0; 17 }