Formats a message string using a variable argument list.

void FormatV(
   PCXSTR pszFormat,
   va_list args


Points to the format-control string. It will be scanned for inserts and formatted accordingly. The format string is similar to run-time function printf-style format strings, except it allows for the parameters to be inserted in an arbitrary order.


Pointer to a list of arguments.

Writes a formatted string and a variable list of arguments to a CStringT string in the same way that vsprintf_s formats data into a C-style character array.

void WriteString(LPCTSTR pstrFormat, ...)
    CString str;

    // format and write the data you were given
    va_list args;
    va_start(args, pstrFormat);

    str.FormatV(pstrFormat, args);

// Call the above WriteString function.
WriteString(_T("%d error(s) found in %d line(s)"), 10, 1351);

Header: cstringt.h