[ Bottom of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]

Technical Reference: Base Operating System and Extensions, Volume 2

vfscanf, vscanf, or vsscanf Subroutine

Purpose

Formats input of an argument list.

Syntax

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

int vfscanf (stream, format, arg)
File *restrict stream
const char  format;
va_list arg;

int vscanf (format, arg)
const char  format;
va_list arg;

int vsscanf (format, arg)
const char  format;
va_list arg;

Description

The vscanf, vfscanf, and vsscanf subroutines are equivalent to the scanf, fscanf, and sscanf subroutines, respectively, except that instead of being called with a variable number of arguments, they are called with an argument list as defined in the <stdarg.h> header file. These subroutines do not invoke the va_end macro. As these functions invoke the va_arg macro, the value of ap after the return is unspecified.

Parameters

stream
format
arg

Return Values

Upon successful completion, these functions shall return the number of successfully matched and assigned input items; this number can be zero in the event of an early matching failure. If the input ends before the first matching failure or conversion, EOF shall be returned. If a read error occurs, the error indicator for the stream is set, EOF shall be returned, and errno shall be set to indicate the error.

Related Information

The scanf, fscanf, sscanf, or wsscanf Subroutine.

[ Top of Page | Previous Page | Next Page | Contents | Index | Library Home | Legal | Search ]