本文共 264 字,大约阅读时间需要 1 分钟。
最近写c程序,学到一种开关宏,极大提高程序的控制性:
#define __DEBUG
#ifdef __DEBUG
#define tnfs_print(format, ...) printf (format, ##__VA_ARGS__) #else #define tnfs_print(format, ...) #endif
如果 定义了 __DEBUG (作为开关)
则调用 tnfs_print()宏 则相当于打印 printf();
相当于debug的一个开关!!!!!
##__VA_ARGS__ 这个宏可以参考:
转载地址:http://rzzjn.baihongyu.com/