vsscanf

Scans input from a string under format control

Local Servers:blocking
Remote Servers:N/A
Classification:Other
Service:String Manipulation

Syntax

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

Parameters

in_string
(IN) Points to the string to be scanned.
format
(IN) Points to the format control string.
arg
(IN) Specifies the variable argument.

Return Values

The vsscanf function returns EOF when the scanning is terminated by reaching the end of the input string. Otherwise, the number of input arguments for which values were successfully scanned and stored is returned.

Remarks

The vsscanf function scans input from the string designated by in_string under control of the argument format. The format list is described with the scanf function.

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

See Also

fscanf, scanf (Single and Intra-File Services), sscanf, va_arg, va_end, va_start

Example

  #include <stdio.h>  
  #include <stdarg.h>  
  .  
  .  
  .  
  int Input (in_data, format, ...)  
  char *in_data, format;  
   
  {  
     va_list    arglist;  
     va_start (arglist, format);  
     return (vsscanf (in_data, format, arglist));  
  }