Determines whether a stream is byte-character- or wide-character-oriented
#include <stdio.h> #include <wchar.h> int fwide ( FILE *fp , int mode );
The fwide( ) function either gets or sets the character type orientation of a file, depending on the value of the mode argument:
In all three cases, the return value of fwide( ) indicates the stream's orientation after the function call in the same way:
The normal usage of fwide( ) is to call it once immediately after opening a file to set it to wide-character orientation. Once you have determined the file's orientation, fwide( ) does not change it on subsequent calls. If you do not call fwide( ) for a given file, its orientation is determined by whether the first read or write operation is byte-oriented or wide-oriented. You can remove a file's byte or wide-character orientation by calling freopen( ). For more information, see "Byte-Oriented and Wide-Oriented Streams" in Chapter 13.
See the example for fputws( ) in this chapter.
The many functions for working with streams of wide characters, listed under wchar.h in Chapter 15.