December 2005
Beginner to intermediate
618 pages
20h 19m
English
ferror
Tests whether a file access error has occurred
#include <stdio.h> intferror( FILE *fp);
The ferror() function—often
implemented as a macro—tests whether an error has been registered in
reading or writing a given file.
ferror()’s argument is a
FILE pointer. One attribute of
the file or stream referenced by this pointer is an error flag which
indicates that an error has occurred during a read or write
operation. The ferror() function
or macro tests the error flag and returns a nonzero value if the
flag is set. If not, ferror()
returns 0.
See the examples for clearerr() and fclose() in this
chapter.
Read now
Unlock full access