C examples for wchar.h:fputwc
function
<cwchar> <wchar.h>
Write wide character to stream
wint_t fputwc (wchar_t wc, FILE * stream);
Parameter | Description |
---|---|
wc | The wide character to write. |
stream | Pointer to a FILE object |
On success, the character written is returned.
#include <stdio.h> int main ()/* w w w . ja v a 2s . com*/ { FILE * pFile; wchar_t wc; pFile = fopen ("example.txt","w"); if (pFile == NULL){ perror("cannot open file"); return -1; } for (wc = L'A' ; wc <= L'Z' ; ++wc) fputwc ( wc , pFile ); fclose (pFile); return 0; }