Could someone tell me why the file doesn\'t change? It works when I use rewind or fseek but not otherwise.
What\'s the standard way of usin
The MS documentation for fopen says this:
When the
"r+","w+", or"a+"access type is specified, both reading and writing are enabled (the file is said to be open for "update"). However, when you switch from reading to writing, the input operation must encounter anEOFmarker. If there is noEOF, you must use an intervening call to a file positioning function. The file positioning functions arefsetpos,fseek, andrewind. When you switch from writing to reading, you must use an intervening call to eitherfflushor to a file positioning function.