![]() Chapter Contents |
![]() Previous |
![]() Next |
| clearerr |
| Portability: | ISO/ANSI C conforming, UNIX compatible |
| SYNOPSIS | |
| DESCRIPTION | |
| RETURN VALUE | |
| IMPLEMENTATION | |
| EXAMPLE | |
| RELATED FUNCTIONS | |
| SEE ALSO |
| SYNOPSIS |
#include <stdio.h> void clearerr(FILE *f);
| DESCRIPTION |
clearerr
clears the error flag and the end-of-file flag for the
FILE
object addressed by
f
.
| RETURN VALUE |
clearerr
has no return value.
| IMPLEMENTATION |
In some cases of a severe error, it is impossible to
continue to use the file. This situation cannot be detected by
clearerr
. The nonstandard function
clrerr
enables you to test for this situation.
| EXAMPLE |
#include <lcio.h>
int fixerr(FILE *f){ /* Clear the error flag for a file. */
clearerr(f);
if (ferror(f)){ /* if error flag still set */
printf("Error on %s is permanent. Program aborted.\n", fnm(f));
abort();
}
return 0; /* Show error flag cleared. */
}
| RELATED FUNCTIONS |
| SEE ALSO |
![]() Chapter Contents |
![]() Previous |
![]() Next |
![]() Top of Page |
Copyright © 2001 by SAS Institute Inc., Cary, NC, USA. All rights reserved.