I'm writing a primitive file compression program; basically the general idea is it reads an inputted file, does some computations and writes a compressed version back to another file, the compressed file. Im using the fstream.h header and the read and write functions.
My textfiles work fine, but various other types of files stop working at certain places. For example in one file it's the 6th byte which happens to be a number 6. The loops and computations still run in the "background" but the variable that im storing in stops getting updated.
I was wondering if there is some weird things that happen when doing binary file i/o specifically that you need to watch out for, like certain bytes can't be read or something like that. I can't think of anything else it could be because it works with the textfiles I've tried.