Site hosted by Angelfire.com: Build your free website today!
Table of Contents Previous Next

1.12.7 <stdio.h>: Error Functions

Many of these functions in the library set status indicators when error or end of file occur.  These indicators may be set and tested explicitly.  In addition, the integer expression errno (declared in <errno.h>) may contain an error number that gives further information about the most recent error.

void clearerr(FILE *stream)
clearerr clears the end of file and error indicators for stream.

int feof(FILE *stream)
feof returns non-zero if the end of file indicator for stream is set.

int ferror(FILE *stream)
ferror returns non-zero if the error indicator for stream is set.

void perror(const char *s)
perror(s) prints s and an implementation-defined error message corresponding to the integer in errno, as if by
   fprintf(stderr, "%s: %s\n", s, "error message")
See strerror.

Table of Contents Previous Next

Last modified: Wed May 03 13:09:25 2000