How a stream error indicator affects following input code?
问题 Each stream has "an error indicator that records whether a read/write error has occurred". It is set, usually rarely, by various functions: fgetc(), fflush(), fseek(), ... . It is cleared by various functions: rewind(), clearerr(), fopen(), ... . int ferror(FILE *stream) reports the state. The ferror function returns nonzero if and only if the error indicator is set for stream . In this case, certainly an input error just occurred. if (!ferror(istream)) { int ch = fgetc(istream); if (ch ==