尝试创建一个宏,可以在定义DEBUG时用于打印调试消息,如下面的伪代码:
#define DEBUG 1
#define debug_print(args ...) if (DEBUG) fprintf(stderr, args)
如何用宏实现这一目标?
在C中,定义类似printf的宏的正确方法是什么,只有在定义了DEBUG符号时才会打印?
#ifdef DEBUG
#define DEBUG_PRINT(???) ???
#else
#define DEBUG_PRINT(???) ???
#endif
哪里??? 是我不知道该填写什么的地方