September 2001
Beginner
970 pages
23h 20m
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 parmN is the identifier used for the last parameter preceding the ellipses. In the preceding examples, parmN 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 RS.V.19 lists three macros to be used in ...
Read now
Unlock full access