In #define LOG(fmt, ...) printf(fmt, __VA_ARGS__), what is __VA_ARGS__?
Variadic macros (C99) substitute the extra arguments as written. With no extra arguments a trailing comma remains – C23 __VA_OPT__ fixes that.
Variable Number of Arguments · Exercise 1 of 4
Twelve multiple-choice questions on variadic functions, stdarg.h macros, promotions, wrappers, variadic macros and C23. Pick an option to check your answer instantly.
In #define LOG(fmt, ...) printf(fmt, __VA_ARGS__), what is __VA_ARGS__?
Variadic macros (C99) substitute the extra arguments as written. With no extra arguments a trailing comma remains – C23 __VA_OPT__ fixes that.
Which change did C23 make?
C23 also added __VA_OPT__ for macros. Type checking is still the programmer's job.
Timed online tests with instant scores and explanations.