Created
September 9, 2022 02:22
-
-
Save itrobotics/b27eeddac8d4a0a56f418d174c33e413 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#include <stdio.h> | |
//#define DEBUG 3 | |
#ifdef DEBUG | |
#define debug(fmt,args...) printf (fmt ,##args) | |
#define debugX(level,fmt,args...) if (DEBUG>=level) printf(fmt,##args); | |
#else | |
#define debug(fmt,args...) | |
#define debugX(level,fmt,args...) | |
#endif /* DEBUG */ | |
int main() | |
{ | |
int n=10; | |
debug("bug found!!\n"); | |
debug("n is %d\n",n); | |
debugX(3,"bug found!!\n"); | |
debugX(4,"n is %d\n",n); | |
return 0; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment