Reading errors and close-time failures

A program successfully opens separate input and output file streams. Its input loop stops when fgets returns NULL; immediately afterward, ferror(in) is nonzero and feof(in) is zero. Separately, fprintf(out, "%s\n", "ready") returns 6, but the subsequent fclose(out) returns EOF. Which conclusions are supported? Select every correct statement.

Choose an answer

Create a free account to get started

Unlock full course notes by signing up

  • Video lessons taught by top educators
  • Practice questions with guided solutions
  • Written review notes for reference
  • Expert answers anytime from course tutors

More Streams Questions: