fwprintf


fwprintf

Writes formatted output in a wide-character string to a file

 #include <stdio.h> #include <wchar.h> int fwprintf ( FILE * restrict fp , const wchar_t * restrict format , ... ); 

The fwprintf( ) function is similar to fprintf( ), except that its format string argument and its output are strings of wide characters.

Example

 wchar_t name_local[ ]   = L"Ka\u0142u\u017Cny"; char    name_portable[ ]= "Kaluzny"; char    locale[ ]       = "pl_PL.UTF-8"; char *  newlocale; newlocale = setlocale( LC_ALL, locale ); if ( newlocale == NULL )   fprintf( stderr, "Sorry, couldn't change the locale to %s.\n"            "The current locale is %s.\n",            locale, setlocale( LC_ALL, NULL )); fwprintf( stdout,           L"Customer's name: %ls (Single-byte transliteration: %s)\n",           name_local, name_portable ); 

If the specified Polish locale is available, this example produces the output:

 Customer's name: Kauny (Single-byte transliteration: Kaluzny) 

See Also

The byte-character output function fprintf( ); the wide-character input functions fgetwc, fgetws, getwc, getwchar, fwscanf, wscanf, vfwscanf, and vwscanf; the wide-character output functions fputwc, fputws, putwc, putwchar, wprintf, vfwprintf, and vwprintf.



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