Question:

Which header needs to be included in C if you are to develop a function that can accept variable number of arguments?

Show Hint

Use \( \text{stdarg.h} \) to handle functions with a variable number of arguments, such as printf.
Updated On: May 3, 2025
  • stdio.h
  • stdarg.h
  • stdvarg.h
  • arg.h
Hide Solution
collegedunia
Verified By Collegedunia

The Correct Option is B

Solution and Explanation

To handle functions with variable numbers of arguments in C, you need to include the header file \( \text{stdarg.h} \). This header defines macros like \( va_list \), \( va_start \), and \( va_arg \), which allow handling variable arguments.
Thus, the correct header to include is \( \text{stdarg.h} \).
Was this answer helpful?
0
0

Top Questions on Programming in C

View More Questions