clearerr
Clears the end-of-file and error indicators for a stream (function or macro)
#include <stdio.h>
void clearerr (
FILE *fp);
The clearerr function or macro clears the end-of-file and error indicators for the file pointed to by fp. These indicators are cleared only when the file is opened or by an explicit call to the clearerr or rewind functions.
#include <stdio.h> main () { FILE *fp; int c; fp=fopen("testfile", "wt"); if (ferror (fp) ) { /* If error,*/ clearerr (fp); /* clear the error */ fputc (c, fp); /* and retry it */ } }