cscanf

Scans input from the current screen under format control

Local Servers:blocking
Remote Servers:N/A
Classification:Other
Service:Device I/O

Syntax

  #include <nwconio.h> 
    
  int cscanf  (  
     const char   *format,   
     ...);
  

Parameters

format

(IN) Points to the format specification string.

Return Values

cscanf returns EOF when the scanning is terminated by reaching the end of the input screen. Otherwise, the number of input arguments for which values have been successfully scanned and stored is returned. When a file input error occurs, errno is set.

Remarks

Following the format string is a list of addresses to receive values. The scanf function uses the function getche to read characters from the console.

See Also

fscanf and scanf (Single and Intra-File Services)

Example

To scan a date in the form "Saturday, April 18 1990":

  #include <nwconio.h>  
   
  main ()  
  {  
     int    day, year;  
     char   weekday[10], month[12];  
     cscanf ("%s %s %d %d", weekday, month, &day, &year);  
  }