Why is fseek or fflush always required between reading and writing in the update modes?
问题 Q: I'm trying to update a file in place, by using fopen mode "r+" , reading a certain string, and writing back a modified string, but it's not working. A: Be sure to call fseek before you write, both to seek back to the beginning of the string you're trying to overwrite, and because an fseek or fflush is always required between reading and writing in the read/write "+" modes. My question is why fseek or fflush is always required between reading and writing in the read/write "+" modes? Section