Multiple choice

Which of the following Standard C functions can be used to reset end-of-file and error conditions on an open stream?

  1. clearerr()

  2. fseek()

  3. ferror()

  4. feof()

  5. setvbuf()

Reveal answer Fill a bubble to check yourself
A Correct answer
Explanation

clearerr() resets both the EOF and error indicators on a stream, allowing further I/O operations. fseek() only clears EOF on some implementations, not errors. feof() and ferror() only test conditions. setvbuf() controls buffering. Only clearerr() explicitly resets error/EOF states.