vcscanf

scan input from the console

Synopsis:

#include <conio.h>
#include <stdarg.h>
int vcscanf( const char *format, va_list args )

Description:

The vcscanf() function scans input from the console, under control of the argument format. The vcscanf() function uses the function getche() to read characters from the console. The format string is described under the description of the scanf() function.

The vcscanf() function is equivalent to the cscanf() function, with a variable argument list replaced with arg, which has been initialized using the va_start() macro.

Returns:

The vcscanf() 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. When a file input error occurs, the errno global variable may be set.

See also:

cscanf(), errno, fscanf(), scanf(), sscanf() , va_arg(), va_end(), va_start() , vfscanf(), vscanf(), vsscanf()

Examples:

#include <conio.h>
#include <stdarg.h>

void cfind( char *format, ... )
  {
    va_list arglist;

    va_start( arglist, format );
    vcscanf( format, arglist );
    va_end( arglist );
  }

void main()
  {
    int day, year;
    char weekday[10], month[12];

    cfind( "%s %s %d %d",
        weekday, month, &day, &year );
    cprintf( "\n%s, %s %d, %d\n",
        weekday, month, day, year );
  }

Classification:

WATCOM

Systems:

All (except DOS/PM)