C Programming/stdio.h/clearerr

Syntax: #include void clearerr( FILE *stream );

The clearerr function resets the error flags and EOF indicator for the given stream. When an error occurs, you can use perror to figure out which error actually occurred.