C库函数 clearerr() C库宏 offsetof() C库函数 ferror() C库函数 clearerr() #include <stdio.h> int main () { FILE *fp; char c; fp = fopen("file.txt", "w"); c = fgetc(fp); if( ferror(fp) ) { printf("Error in reading from file : file.txt\n"); } clearerr(fp); if( ferror(fp) ) { printf("Error in reading from file : file.txt\n"); } fclose(fp); return(0); } C库宏 offsetof() C库函数 ferror()