LearnFrenzy
Sign in Take a free test

Variable Number of Arguments · Variable Arguments MCQ · Question 11

What does __VA_ARGS__ represent? Answer, explanation & discussion

  • MCQ
  • Easy
  • 0 comments
  • Answer explained
  • Moderated community
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!

Post your comment

Comments appear after a quick review by our team.

Search LearnFrenzy

Esc

Quick links