Pointer to the file stream from which a wide character is to be read
Read more about parameters of getwc in parameters section
The getwcfunction in C language Gets a wide character from the specified stream.
The getwc function obtains the next wide character (if present) as a wchar_t converted to a wint_t, from the input stream pointed to by stream, and advances the associated file position indicator for the stream (if defined). getwc is equivalent to fgetwc except that it may be implemented as a macro.
The getwcfunction takes 1
parameter:
•
FILE * `stream`: Pointer to the file stream from which a wide character is to be read
Reads the next wide character from the specified file stream and returns it as a `wint_t`. Returns `WEOF` if the end-of-file is reached or an error occurs.
The getwc function return value :
Returns the wide character read as a wint_t, or WEOF on end-of-file or error
Use feof() and ferror() to distinguish between end-of-file and error
Output
This example shows how to read and print wide characters from a file using getwc.