Skip to content

Instantly share code, notes, and snippets.

@itrobotics
Created September 9, 2022 02:22
Show Gist options
  • Save itrobotics/b27eeddac8d4a0a56f418d174c33e413 to your computer and use it in GitHub Desktop.
Save itrobotics/b27eeddac8d4a0a56f418d174c33e413 to your computer and use it in GitHub Desktop.
#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