If you need to change the content of a file (that is overwrite it) then you have to:
- Read the file content into memory.
- Modify memory content.
- Write back modified memory content to the original file.
You may use the
C++
fstream
to read/write a binary file, see, for instance
Input/Output with files[
^] for code samples.
You may as well use the
C
-like functions fopen,fwrite,fread for doing the same. See, for instance
fopen[
^]
fwrite[
^],
fread[
^].