Question 11
Back to Exercise
In #define LOG(fmt, ...) printf(fmt, __VA_ARGS__), what is __VA_ARGS__?
- A The number of arguments
- B The arguments that matched the ..., with their commas Correct
- C A va_list
- D The format string
Correct Answer: Option B
Variadic macros (C99) substitute the extra arguments as written. With no extra arguments a trailing comma remains – C23 __VA_OPT__ fixes that.
Discussion & Comments 0
Share your method, a shortcut, or ask about a step you didn't follow.
No comments yet. Be the first to share your solution!