Wide-Character Formatted Input and Output

Input and output functions for formatting wide character strings.

  #include <wchar.h> 
  int fwprintf(FILE * file, const wchar_t * format, ...); 
  int fwscanf(FILE * file, const wchar_t * format, ...); 
  int swprintf(wchar_t * S, size_t N, const wchar_t * format, ...); 
  int vfwprintf(FILE * file, const wchar_t * format_str, va_list arg); 
  int vswprintf(wchar_t * restrict s, size_t n, const wchar_t * restrict format, va_list arg); 
  int vwprintf(const wchar_t * format, va_list arg); 
  int wprintf(const wchar_t * format, ...); 
  int swscanf(const wchar_t * s, const wchar_t * format, ...); 
  int vfwscanf(FILE * file, const wchar_t * format_str, va_list arg); 
  int vswscanf(const wchar_t * s, 
  const wchar_t * format, va_list arg); 
  int vwscanf(const wchar_t * format, va_list arg); 
  int wscanf(const wchar_t * format, ...);   

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 Formatting Functions
Function Wide Character Equivalent
fwprintf() fprintf()
swprintf() sprintf()
vfwprintf() vfprintf()
vswprintf() vsprintf()
vwprintf() vprintf()
wprintf() printf()
fwscanf() fscanf()
swscanf() sscanf()
vfwscanf() vfscanf()
vswscanf() vsscanf()
vscanf() vscanf()
wscanf() scanf()