Name
vfwscanf, vswscanf, vwscanf
Synopsis
Reads formatted wide-character input using a variable argument list object
#include <stdarg.h> #include <wchar.h> intvswscanf
( const wchar_t * restricts
, const wchar_t * restrictformat
, va_listargptr
); intvwscanf
( const wchar_t * restrictformat
, va_listargptr
); #include <stdio.h> // (in addition to <stdarg.h> and <wchar.h>) intvfwscanf
( FILE * restrictfp
, const wchar_t * restrictformat
, va_listargptr
);
The functions vfwscanf()
,
vswscanf()
, and vwscanf()
are like fwscanf()
, swscanf()
, and wscanf()
, respectively, except that their
final argument, argptr
, is a
variable-argument list object with type va_list
. The program must initialize this
object by calling the va_start()
macro before calling the vfwscanf()
, vswscanf()
, or vwscanf()
function, and must call the
va_end()
macro after the function
returns. Because these functions use the va_arg()
macro internally to advance the
pointer through the argument list, its value is indeterminate after
the vfwprintf()
, vswprintf()
, or vwprintf()
function call has
returned.
The vfwscanf()
, vswscanf()
, and vwscanf()
functions return the number of
input items assigned to variables, which may be 0; or EOF
if an input failure occurs before any
conversion takes place.
Example
See the example for the corresponding byte-character function
vfscanf()
in this chapter.
Get C in a Nutshell now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.