1. 可变参数宏

1.1 C99 标准中可变参数宏

#define debug(format, ...) printf(format, ##__VA_ARGS__)

1.2 gcc 复杂宏

 #define debug(format, args...) printf(format, ##args)

#的作用 : 连接两个宏,如果可变参数被忽略或为空,"##"操作将使预处理器(preprocessor)去除掉它前面的那个逗号.

09-26 16:22