ferror Function (Macro)

stdio.h

short ferror (FILE *stream);

Tests a stream for a read or write error.

ferror is a macro that tests the stream associated to the structure pointed to by stream for a read or write error. It the stream's error indicator has been set, it remains set (and all file I/O operations will return error) until clearerr or rewind is called, or until the stream is closed. ferror returns nonzero if an error was detected on the named stream.