2.17 Variable-Length Argument Lists

The va_arg, va_end, and va_start routines are macros that provide a portable way to access the arguments to a function when the function takes a variable number of arguments. Two versions of the macros are available: the macros defined in the VARARG.H include file, which are compatible with the UNIX System V definition, and the macros defined in STDARG.H, which conform to the ANSI C standard.

Routine Use

va_arg Retrieves argument from list
va_end Resets pointer
va_start Sets pointer to beginning of argument list

For more information on the differences between the two versions and for an explanation of how to use the macros, see their descriptions in Part 2 of this book.