Warning: main(/www/www/htdocs/style/globals.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/v/vfscanf.html on line 1

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/globals.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/v/vfscanf.html on line 1

Warning: main(/www/www/htdocs/style/header.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/v/vfscanf.html on line 8

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/header.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/v/vfscanf.html on line 8

vfscanf()

Scan input from a file (varargs)

Synopsis:

#include <stdio.h>
#include <stdarg.h>

int vfscanf( FILE *fp,
             const char *format,
             va_list arg );

Arguments:

fp
The stream that you want to read from.
format
A string that specifies the format of the input. For more information, see scanf(). The formatting string determines what additional arguments you need to provide.
arg
A variable-argument list of the additional arguments, which you must have initialized with the va_start() macro.

Library:

libc

Use the -l c option to qcc to link against this library. This library is usually included automatically.

Description:

The vfscanf() function scans input from the file designated by fp, under control of the argument format.

The vfscanf() function is a “varargs” version of fscanf().

Returns:

The number of input arguments for which values were successfully scanned and stored, or EOF when the scanning is stopped by reaching the end of the input stream before storing any values.

Errors:

If an error occurs, errno indicates the type of error.

Examples:

#include <stdio.h>
#include <stdlib.h>
#include <stdarg.h>

void ffind( FILE *fp, char *format, ... )
  {
    va_list arglist;

    va_start( arglist, format );
    vfscanf( fp, format, arglist );
    va_end( arglist );
  }

int main( void )
  {
    int day, year;
    char weekday[10], month[12];

    ffind( stdin,
        "%s %s %d %d",
        weekday, month, &day, &year );
    printf( "\n%s, %s %d, %d\n",
        weekday, month, day, year );
    return EXIT_SUCCESS;
  }

Classification:

ANSI, POSIX 1003.1

Safety:
Cancellation point Yes
Interrupt handler No
Signal handler No
Thread Yes

See also:

errno, fscanf(), fwscanf(), scanf(), sscanf(), swscanf(), va_start(), vfwscanf(), vscanf(), vsscanf(), vswscanf(), vwscanf(), wscanf()


Warning: main(/www/www/htdocs/style/footer.php) [function.main]: failed to open stream: No such file or directory in /www/www/docs/6.4.1/neutrino/lib_ref/v/vfscanf.html on line 182

Warning: main() [function.include]: Failed opening '/www/www/htdocs/style/footer.php' for inclusion (include_path='.:/www/www/common:/www/www/php/lib/php') in /www/www/docs/6.4.1/neutrino/lib_ref/v/vfscanf.html on line 182