Pointer to the file stream whose orientation is to be set or queried
2nd Parameter Type : int
Integer type (typically 4 bytes, -2,147,483,648 to 2,147,483,647)
2nd Parameter
Determines the desired orientation: a positive value sets wide orientation, a negative value sets byte orientation, and zero queries the current orientation
Read more about parameters of fwide in parameters section
The fwidefunction in C language Sets the orientation of the stream to wide or narrow.
The fwide function determines or changes the orientation of the stream. A stream can have a wide orientation (for wide character I/O), a narrow orientation (for byte I/O), or no orientation. If mode is greater than zero, fwide tries to make the stream wide-oriented. If mode is less than zero, it tries to make it byte-oriented. If mode is zero, fwide merely determines the current orientation of the stream without changing it.
The fwidefunction takes 2
parameters:
•
FILE * `stream`: Pointer to the file stream whose orientation is to be set or queried
•
int `mode`: Determines the desired orientation: a positive value sets wide orientation, a negative value sets byte orientation, and zero queries the current orientation
Sets or queries the orientation of the specified file stream. Returns a positive value if the stream is wide-oriented, a negative value if it is byte-oriented, or zero if the stream has no orientation.
The fwide function return value :
Returns a positive value if the stream is wide-oriented after the call, a negative value if it is byte-oriented, or zero if it has no orientation
Output
This example demonstrates the basic usage of fwide. It opens a file, checks its initial orientation, sets it to wide orientation, and then attempts to change it to byte orientation (which should fail as orientation can only be set once).