- 可变参数宏
- variadic macros
- 允许使用“可变化的参数表”的宏
- 代码
#define debug(...) printf(__VA_ARGS__)
debug("hello world"); // hello world
debug("name = %s\n", "linduo") // name = linduo
- define debug(…) printf(VA_ARGS)
- ”…” 省略号,表示一个可变化的参数表
- “VA_ARGS”,使用该保留名把参数传递给宏
- 可变参数宏不被ANSI/ISO C++ 正式支持。