Name
vfwprintf, vswprintf, vwprintf
Synopsis
Prints formatted wide-character output using a variable argument list object
#include <stdarg.h> #include <wchar.h> intvfwprintf( FILE *fp, const wchar_t * restrictformat, va_listargptr); intvswprintf( wchar_t * restricts, size_tn, const wchar_t * restrictformat, va_listargptr); intvwprintf( const wchar_t * restrictformat, va_listargptr);
The functions vfwprintf(),
vswprintf(), and vwprintf() are like fwprintf(), swprintf(), and wprintf(), respectively, except that their
last argument, argptr, is a
variable-argument list object with type va_list. The program must initialize this
object by calling the va_start()
macro before calling the vfwprintf(), vswprintf(), or vwprintf() function, and must call the
va_end() macro after the function
returns. Because these functions use the va_arg() macro internally to advance the
pointer through the argument list, its value is indeterminate after
the vfwprintf(), vswprintf(), or vwprintf() function call has
returned.
The vfwprintf() and
vwprintf() functions return the
number of wide characters written to the output stream, or a
negative value if an error occurred. The vswprintf() function returns the number of
wide characters written to the output buffer, not counting the
terminating null wide character, or a negative value if an encoding
error occurred or if the complete output string would have contained
more than n wide characters.
Example
See the example for the corresponding byte-character ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Read now
Unlock full access