U

Uday Singh • 7.23K Points
Tutor III

Q. What will initialize the list of arguments in stdarg.h header file?

  • (A) va_start
  • (B) va_arg
  • (C) va_list
  • (D) All of above
  • Correct Answer - Option(A)
  • Views: 233
  • Filed under category C++

Explanation by: Mr. Dubey

In the C standard library <stdarg.h>, used for handling variable argument lists, the roles of each macro/type are as follows:

va_list:
This is a type used to declare a variable that will hold the information needed to retrieve the additional arguments.

va_start(va_list, last_fixed_param):
This initializes the va_list variable so it can be used to retrieve the variable arguments. This is the correct answer to the question.

va_arg(va_list, type):
This retrieves the next argument in the list.

So only va_start is responsible for initializing the list of arguments.

✅ Correct Answer: (A) va_start

You must be Logged in to update hint/solution

Discusssion

Login to discuss.


Question analytics