Hi, I want to open a binary file for reading and writing (without truncation, not for adding). I use the "r + b" mode. I do not get compilation of errors, but when I read what I wrote, I get garbage values. Any idea.
But if I open the file for writing (mode like "wb"), write it to ... close it, and then open the file for reading (mode "rb") and read it, then it works fine,
source
share