vscanf

Scans input from the stream designated by stdin

Local Servers:blocking
Remote Servers:blocking
Platform:NLM
Service:Stream I/O

Syntax

  #include <stdio.h>  
  #include <stdarg.h>  
   
  int  vscanf  (  
     const char   *format,   
     va_list       arg);
  

Parameters

format
(IN) Points to the format control string.
arg
(OUT) Specifies a variable argument.

Return Values

The vscanf 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.

Remarks

The vscanf function scans input from the file designated by stdin under control of the argument format. The format list is described with the scanf function.

The vscanf function is equivalent to the scanf function, with a variable argument list replaced with arg, which has been initialized using the va_start macro

See Also

fscanf, scanf, sscanf, va_arg, va_end, va_start (NDK: Program Management)

vscanf Example

  #include <stdio.h>  
  #include <stdarg.h>  
   
  void find (char *format, char *arg, ... )  
  {  
     va_list arglist;  
     va_start (arglist, arg);  
     vscanf (format, arglist);  
     va_end (arglist );  
  }