fgetwc - get a wide-character code from a stream
#include <stdio.h>
#include <wchar.h>
The functionality described on this reference page is aligned with the ISO C standard. Any conflict between the requirements described here and the ISO C standard is unintentional. This volume of IEEE Std 1003.1-2001 defers to the ISO C standard.
The fgetwc() function shall obtain the next character (if present) from the input stream pointed to by stream, convert that to the corresponding wide-character code, and advance the associated file position indicator for the stream (if defined).
If an error occurs, the resulting value of the file position indicator for the stream is unspecified.
The fgetwc() function may mark the st_atime field of the file associated with stream for update. The st_atime field shall be marked for update by the first successful execution of fgetc(), fgets(), fgetwc(), fgetws(), fread(), fscanf(), getc(), getchar(), gets(), or scanf() using stream that returns data not supplied by a prior call to ungetc() or ungetwc().
Upon successful completion, the fgetwc() function shall return the wide-character code of the character read from the input stream pointed to by stream converted to a type wint_t. If the stream is at end-of-file, the end-of-file indicator for the stream shall be set and fgetwc() shall return WEOF. If a read error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error. If an encoding error occurs, the error indicator for the stream shall be set, fgetwc() shall return WEOF, and shall set errno to indicate the error.
The fgetwc() function shall fail if data needs to be read and:
The fgetwc() function may fail if:
The following sections are informative.
The ferror() or feof() functions must be used to distinguish between an error condition and an end-of-file condition.
feof() , ferror() , fopen() , the Base Definitions volume of IEEE Std 1003.1-2001, <stdio.h>, <wchar.h>
Закладки на сайте Проследить за страницей |
Created 1996-2024 by Maxim Chirkov Добавить, Поддержать, Вебмастеру |