stdarg.h
is a header in the C standard library of the C programming language that allows functions to accept an indefinite number of arguments. It provides facilities for stepping through a list of function arguments of unknown number and type. C++ provides this functionality in the headercstdarg
.
- The contents of
stdarg.h
are typically used in variadic functions, though they may be used in other functions (for example,vprintf
) called by variadic functions.
- stdarg.h header defines a variable type va_list and three macros which can be used to get the arguments in a function when the number of arguments are not known i.e. variable number of arguments.
Library Variables
- va_list
Library Macros
This macro initializes ap variable to be used with the va_arg and va_end macros. The last_arg is the last known fixed argument being passed to the function i.e. the argument before the ellipsis. |
|
|
|
|
Example :
more at :
https://en.wikipedia.org/wiki/Stdarg.h
http://www.tutorialspoint.com/c_standard_library/stdarg_h.htm