Retro video games delivered to your door every month!
Click above to get retro games delivered to your door ever month!
X-Hacker.org- Watcom C Library Reference - <u>synopsis:</u> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <conio.h>
    #include <stdarg.h>
    int vcprintf( const char *format, va_list arg );

Description:
    The vcprintf function writes output directly to the console under
    control of the argument format.  The  putch function is used to output
    characters to the console.  The format string is described under the
    description of the  printf function.  The vcprintf function is
    equivalent to the  cprintf function, with the variable argument list
    replaced with arg, which has been initialized by the  va_start macro.

Returns:
    The vcprintf function returns the number of characters written, or a
    negative value if an output error occurred.  When an error has occurred,
     errno contains a value indicating the type of error that has been
    detected.

Example:
    #include <conio.h>
    #include <stdarg.h>
    #include <time.h>

    #define ESCAPE 27

    void tprintf( int row, int col, char *format, ... )
     {
        auto va_list arglist;

        cprintf( "%c[%2.2d;%2.2dH", ESCAPE, row, col );
        va_start( arglist, format );
        vcprintf( format, arglist );
        va_end( arglist );
     }

    void main()
      {
        struct tm  time_of_day;
        time_t     ltime;
        auto char  buf[26];

        time( &ltime );
        _localtime( &ltime, &time_of_day );
        tprintf( 12, 1, "Date and time is: %s\n",
                _asctime( &time_of_day, buf ) );
      }

Classification:
    WATCOM

Systems:
    All, Netware

See Also:
    _bprintf, cprintf, fprintf, printf, sprintf, va_arg, va_end, va_start,
    _vbprintf, vfprintf, vprintf, vsprintf

See Also: cprintf va_arg

Online resources provided by: http://www.X-Hacker.org --- NG 2 HTML conversion by Dave Pearson