VFPRINTF - print variable argument list.

(ANSI Standard)

Usage:

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

Where:

FILE *fp;
is the file pointer for the file where the output should be printed.
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.

Description:

"vfprintf" is the same as "fprintf" 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, "vfprintf" will start at the first argument that has not yet been obtained through "va_arg". "vfprintf" effectively uses "va_arg" to obtain arguments from the variable list; therefore a call to "va_arg" after "vfprintf" will obtain the argument AFTER the last argument printed.

After a call to "vfprintf", 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 lib fprintf

expl c include stdarg

Copyright © 1996, Thinkage Ltd.