In GNU C, a macro can accept a variable number of arguments, just like a function
__va_args__ can be regarded as the ... Assign a value to the macro
// Note you can't call ABC () #include <stdio.h> #include <stdarg.h> #define ABC (...) printf (__va_args__) /* void ABC (...) {//printf (__va_args__);} */ int Main () {ABC ( " %s\n , " hello ); return 0 ;}
Note that the macro can accept mutable parameters rather than functions (the variable number of parameters involved in the function requires va_list).
In addition __va_args__ is a variable parameter of the macro, very few people know this macro, this variable parameter of the macro is new C99 specification, it seems that only GCC support (VC6.0 compiler does not support). The macro front Plus # #的作用在于, when the number of variable parameters is 0 o'clock, here the # #起到把前面多余的 "," remove the effect, otherwise it will compile error, you can try.
C Language # # __VA_ARGS__ macro