vprintf()

Declaration

int vprintf(const char* kcpFormatString, va_list qVarArgList);

Description:

This function writes the formatted string "kcpFormatString" to the standard output stream "stdout," using the arguments in the argument list "qVarArgList." The function returns the number of characters that were written to the stream, or returns a negative number to indicate that an error occurred.

Example

#include <cstdio>
#include <cstdarg>

int main()
{
    // An argument list - the first entry is just a count.
    int iaArguments[] = {2, 10, 20};
    va_list qVarArg = 0;
    va_start(qVarArg, iaArguments[0]);

    // Use a var arg list to output two integers
    vprintf("%d %d\n", qVarArg);

    va_end(qVarArg);

    return 0;
}

Output:

vprintf() Output