#include <stdio.h> int ferror(FILE *f);
ferror
tests whether the error flag has been set for the FILE
object addressed by f
. This flag is set whenever an I/O function
fails for any reason. The error flag for a file remains set after an error
until it is cleared with clearerr
.
ferror
returns 0 if the error flag is not set and a nonzero value if the
error flag is set.
ferror(f)
(where f
addresses a FILE object for a file closed by
fclose
) is nonzero. Other implementations may return 0 if ferror
is used on a closed file.
ferror
is illustrated in the example for ftell
.
clearerr
, clrerr
,feof
Copyright (c) 1998 SAS Institute Inc. Cary, NC, USA. All rights reserved.