vfwprintf(3S) SDK R4.11 vfwprintf(3S)
NAME
vfwprintf, vwprintf, vswprintf - print formatted wide character
output of a variable argument list
SYNOPSIS
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
int vfwprintf(FILE *stream, const wchar_t *format, va_list arg);
int vwprintf(const wchar_t *format, va_list arg);
int vswprintf(wchar_t s, size_t n, const wchar_t *format,va_list arg);
DESCRIPTION
vfwprintf is equivalent to fwprintf, with the variable argument list
replaced by an arg that has been initialized by the va_start macro.
vwprintf is equivalent to wprintf, with the variable argument list
replaced by an arg that has been initialized by the va_start macro.
vswprintf is equivalent to swprintf, with the variable argument list
replaced by an arg that has been initialized by the va_start macro.
If copying takes place between objects that overlap, the behavior is
undefined.
None of these functions invoke va_end or the passed arg.
Errors
vfwprintf and vwprintf return the number of wide characters
transmitted or return a negative value if an error was encountered.
vswprintf returns the number of wide characters written in the array,
not counting the terminating null wide character, or returns a
negative value if n or more wide character are requested to be
generated.
USAGE
The following example shows the use of the vfwprintf function in a
general error reporting routine:
#include <stdarg.h>
#include <stdio.h>
#include <wchar.h>
void error(wchar_t *function_name, wchar_t *format,...)
{
va_list args;
va_start(args, format);
fwprintf(stderr, L"ERROR in %s: ", function_name);
vfwprintf(stderr, format, args);
va_end(args);
}
REFERENCES
printf(3S), fwprintf(3S), scanf(3S), setlocale(3C), stdio(3S),
write(2)
Licensed material--property of copyright holder(s)