Syntax | #include <stdio.h> int ferror(FILE *stream); |
Description ferror()
tests the error indicator for the stream pointed to by stream.
Return val. |
0 | if the error indicator is set for stream. if the error indicator is not set for stream. |
Notes
The error indicator remains set until the associated file pointer is released (e.g. by a
rewind()
, fclose()
or program termination) or until the clearerr()
function is called.
The program environment determines whether ferror()
is executed for a BS2000 or POSIX file.
BS2000ferror()
is implemented both as a macro and as a function.
ferror()
should always be used when reading from a file or writing to it.
ferror()
can also be used unchanged on files with record I/O. (End)
See also clearerr()
, feof()
, fopen()
, stdio.h
.