[阅读: 519] 2007-02-23 17:15:16
#define myprintf(level, x) \
{ \
if ( (level) <= DEFAULT_LEVEL ) \
printf x; \
}
When we want to call...
myprintf(DEBUG_LEVEL, ("We got this debug message with an int %d and string %s\n", 23, "String arg"));
Very simple and portable.