Versions Compared

Key

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

...

The C Standard, subclause 7.19.5.3, paragraph 6, places the following restrictions on FILE objects opened for both reading and writing [ISO/IEC 9899:1999]:

When a file is opened with update mode . . ., both input and output may be performed on the associated stream. However, output shall not be directly followed by input without an intervening call to the fflush function or to a file positioning function (fseekfsetpos, or rewind), and input shall not be directly followed by output without an intervening call to a file positioning function, unless the input operation encounters end-of-file.

...

Bibliography

[ISO/IEC 9899:1999]Subclause 7.19.5.3, "The fopen Function"
[ISO/IEC 14882-2014]Clause 27, "Input/Output Library"

...