I am trying to save data for characters for a game.
After I save the first one, which works fine, I create the second one and save. For some reason it writes over the first character with nothing, basically deleting it. The second one gets written, but at some offset nott matching the one I created by multiplying the size of the string by the number of the character created.
The following is the code:
savefile.open ("save.txt",ios::out |ios::binary);
savefile.seekp (pos * r_cnt,ios::beg);
savefile.write((char *)(&chrs[r_cnt]), sizeof(chrs));