I have a binary file that I need to open and alter the first 4 bytes without messing with the rest of the data. How would I go about doing this? I was thinking I could use fwrite but what option would I use with fopen?
I have a binary file that I need to open and alter the first 4 bytes without messing with the rest of the data. How would I go about doing this? I was thinking I could use fwrite but what option would I use with fopen?
>what option would I use with fopen
"rb+" obvoiusly is exactly what you want. It says open binary file for reading and writing starting from the beginning of the file.
The only good is knowledge and the only evil is ignorance.
~Socrates
wow, can't believe I missed that. Thanks.