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/C++ v10.0 : C library - <b>synopsis:</b> http://www.X-Hacker.org [<<Previous Entry] [^^Up^^] [Next Entry>>] [Menu] [About The Guide]
Synopsis:
    #include <stdio.h>
    #include <stdarg.h>
    int _vbprintf( char *buf, unsigned int bufsize,
                   const char *format, va_list arg );

Description:
    The _vbprintf function formats data under control of the format control
    string and writes the result to buf.  The argument bufsize specifies the
    size of the character array buf into which the generated output is
    placed.  The format string is described under the description of the
     printf function.  The _vbprintf function is equivalent to the  _bprintf
    function, with the variable argument list replaced with arg, which has
    been initialized by the  va_start macro.

Returns:
    The _vbprintf function returns the number of characters written, or a
    negative value if an output error occurred.

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

Example:
    The following shows the use of _vbprintf in a general error message
    routine.

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

    char msgbuf[80];

    char *fmtmsg( char *format, ... )
      {
        va_list arglist;

        va_start( arglist, format );
        strcpy( msgbuf, "Error: " );
        _vbprintf( &msgbuf[7], 73, format, arglist );
        va_end( arglist );
        return( msgbuf );
      }

    void main()
      {
        char *msg;

        msg = fmtmsg( "%s %d %s", "Failed", 100, "times" );
        printf( "%s\n", msg );
      }

Classification:
    WATCOM

Systems:
    All

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