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 <stdarg.h>
    #include <stdio.h>
    int vprintf( const char *format, va_list arg );
    #include <stdarg.h>
    #include <wchar.h>
    int vwprintf( const wchar_t *format, va_list arg );

Description:
    The vprintf function writes output to the file  stdout under control of
    the argument format.  The format string is described under the
    description of the  printf function.  The vprintf function is equivalent
    to the  printf function, with the variable argument list replaced with
    arg, which has been initialized by the  va_start macro.

    The vwprintf function is identical to vprintf except that it accepts a
    wide-character string argument for format.

Returns:
    The vprintf function returns the number of characters written, or a
    negative value if an output error occurred.  The vwprintf function
    returns the number of wide 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:
    The following shows the use of vprintf in a general error message
    routine.

    #include <stdio.h>
    #include <stdarg.h>

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

        printf( "Error: " );
        va_start( arglist, format );
        vprintf( format, arglist );
        va_end( arglist );
      }

    void main()
      {
        errmsg( "%s %d %s", "Failed", 100, "times" );
      }

Classification:
    vprintf is ANSI, vwprintf is ANSI

Systems:
     vprintf - All, Netware

    vwprintf - All

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

See Also: cprintf va_arg

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