Your Browser is not longer supported

Please use Google Chrome, Mozilla Firefox or Microsoft Edge to view the page correctly
Loading...

{{viewport.spaceProperty.prod}}

ferror - test error indicator on stream

&pagelevel(4)&pagelevel

Syntax

#include <stdio.h>

int ferror(FILE *stream);

Description ferror() tests the error indicator for the stream pointed to by stream.

Return val.

!= 0

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.

BS2000
ferror() 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.