vfscanf
Scans input from a stream under format control
#include <stdio.h> #include <stdarg.h> int vfscanf ( FILE *fp, const char *format, va_list arg);
The vfscanf function returns EOF when the scanning is terminated by reaching the end of the input stream. Otherwise, the number of input arguments for which values were successfully scanned and stored is returned. If a file input error occurs, errno is set.
The vfscanf function scans input from the file designated by fp under control of the argument format. The format list is described with the scanf function.
The vfscanf function is equivalent to the fscanf function, with a variable argument list replaced with arg, which has been initialized using the va_start macro.
#include <stdio.h> #include <stdarg.h> main () { auto va_list arglist; va_start (arglist, arg); vfprintf (fp, format, arglist); va_end (arglist); }