C examples for wchar.h:vwprintf
function
<cwchar> <wchar.h>
Print formatted data from variable argument list to stdout
int vwprintf (const wchar_t* format, va_list arg);
Parameter | Description |
---|---|
format | a printf format string |
arg | a variable arguments |
On success, the total number of characters written is returned.
On error, the error indicator ferror is set and a negative number is returned.
#include <stdarg.h> #include <wchar.h> void WriteWideFormatted ( const wchar_t * format, ... ) { va_list args;//from w w w . j av a 2 s.c om va_start (args, format); vwprintf (format, args); va_end (args); } int main () { WriteWideFormatted (L"Call with %d variable argument.\n",1); WriteWideFormatted (L"Call with %d variable %ls.\n",2,L"arguments"); return 0; }