Everything

ferror


Tests for stream input/output file error state.

[Format]

#include <stdio.h>

long ferror (FILE *fp);

[Parameters]

fp File pointer

[Return values]

If file is in error state: Nonzero

Otherwise: 0

[Remarks]

The ferror function tests whether the stream input/output file indicated by file pointer fp is in the error state.

The ferror function tests the error indicator for the specified stream input/output file, and if the indicator is set, returns nonzero to show that the file is in the error state. If the error indicator is not set, the ferror function returns zero to show that the file is not in the error state.