vfwprintf, vswprintf, vwprintf


vfwprintf, vswprintf, vwprintf

Prints formatted wide-character output using a variable argument list object

 #include <stdarg.h> #include <wchar.h> int vfwprintf ( FILE *fp , const wchar_t * restrict format , va_list argptr  ); int vswprintf ( wchar_t * restrict s , size_t n ,                const wchar_t * restrict format , va_list argptr  ); int vwprintf ( const wchar_t * restrict format , va_list argptr  ); 

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 function vfprintf( ) in this chapter.

See Also

vfwscanf( ), vswscanf( ), and vwscanf( )



C(c) In a Nutshell
C in a Nutshell (In a Nutshell (OReilly))
ISBN: 0596006977
EAN: 2147483647
Year: 2006
Pages: 473

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net