(ANSI Standard)
#include <stdarg.h> #include <stdio.h> nout = vfprintf(fp,format,varlist);
"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.
Copyright © 1996, Thinkage Ltd.