Reads the next character from a specified file, and converts it to a
wide-character code.
Format
#include <wchar.h>
wint_t fgetwc (FILE *file_ptr);
Arguments
- file_ptr
- A pointer to the file to be accessed.
Description
Upon successful completion, the fgetwc function returns the
wide-character code read from the file pointed to by file_
ptr and converted to type wint_t. If the file is at end-of-
file, the end-of-file indicator is set, and WEOF is returned. If an
I/O read error occurred, then the error indicator is set, and WEOF
is returned.
Applications can use ferror or feof to distinguish between an error
condition and an end-of-file condition.
Return Values
x | The wide-character code of
the character read. |
WEOF |
Indicates the end-of-file or an error. If a read error occurs,
the function sets errno to one of the following:
- EALREADY - An operation is already in progress on the same
file.
- EBADF - The file descriptor is not valid.
- EILSEQ - Invalid character detected.
|
Previous Page | Next Page | Table of Contents | Index