VPRINTF - print variable argument list on "stdout".

(ANSI Standard)


#include <stdarg.h>
#include <stdio.h>
nout = vprintf(format,varlist);


const char *format;
is a standard "printf" format string.
va_list varlist;
is a variable argument list consisting of the values to be printed.
int nout;
is the number of characters output. If the print operation failed for some reason, a negative number is returned.


"vprintf" is the same as "printf" except that it prints out a number of values from a variable argument list. The "varlist" variable must have been initialized with the "va_start" macro. If there have already been calls to "va_arg" to obtain arguments from the variable list, "vprintf" will start at the first argument that has not yet been obtained through "va_arg". "vprintf" effectively uses "va_arg" to obtain arguments from the variable list; therefore a call to "va_arg" after "vprintf" will obtain the argument AFTER the last argument printed.

After a call to "vprintf", the "varlist" variable should be assumed to be in an undefined state. If you want to use "varlist" again, you must call "va_end" to clean up, then "va_start" to reinitialize it.

See Also:

expl c lib printf

expl c incl stdarg

Copyright © 1996, Thinkage Ltd.