Wide-Character Input and Output

Character input and output functions for wide characters.

  include <wchar.h> 
  wchar_t fgetwc(FILE * file); 
  wchar_t *fgetws(wchar_t * s, int n, FILE * file); 
  wchar_t getwc(FILE * file); 
  wchar_t getwchar(void); 
  wchar_t fputwc(wchar_t c, FILE * file); 
  int fputws(const wchar_t * s, FILE * file); 
  wchar_t putwc(wchar_t c, FILE * file); 
  wchar_t putwchar(wchar_t c);   

These functions operate identically to their counterpart functions in stdio.h. But instead of operating on character strings, these functions operate on wide character strings.

The table below matches these wide character functions to their equivalent char-based functions in stdio.h.
Table 1. Wide Character Input/Output Functions
Function Wide Character Equivalent
fgetwc() fgetc()
fgetws() fgets()
fputwc() fputc()
fputws() fputs()
getwc() getc()
getwchar() getchar()
putwc() putc()
putwchar() putchar()