2.12.3.4 ferror

Declaration:

int ferror(FILE *stream);

Tests the error indicator for the given stream. If the error indicator is set, then it returns a nonzero value. If the error indicator is not set, then it returns zero.