Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

Using the value of a pointer to a FILE object after the associated file is closed is undefined behavior. (see See undefined behavior 148.) . Programs that close the standard streams (especially stdout but also stderr and stdin) must be careful not to use these streams in subsequent function calls, particularly those that implicitly operate on them (such as printf(), perror(), and getc()).

...