September 1998
Intermediate to advanced
848 pages
20h 13m
English
The stdarg.h header file provides a means for defining a function having a variable number of arguments. The prototype for such a function should have a parameter list with at least one parameter followed by ellipses:
void f1(int n, ...); /* valid */ int f2(int n, const char * s, ...); /* valid */ double f3(...); /* invalid */
In the following, the term lastparm is the identifier used for the last parameter preceding the ellipses. In the preceding examples, lastparm would be n for the first case and s for the second case.
The header file declares a va_list type to represent a data object used to hold the parameters corresponding to the ellipses part of the parameter list. Table F.11 lists three macros to be used ...
Read now
Unlock full access