Hi, i am creating a little c++ rpg game and now i have trouble with saving and loading data.
For saving game, i just have to output all the info of my hero to a txt file. To do that, i use something like this:
Loading Game:Code:outfile.open("SaveLoadgame.txt"); ... ... outfile<<name<<endl<<stamina<<endl<<hp<<endl;
For loading game i read into the same txt file(which i think i cannot do that)
But the problem is after saving the game and close it, then i restart it , my txt file automatically become blank. Therefore there are nothing to load....Code:myFile.open("SaveLoadgame.txt"); ... ... myFile>>name; myFile>>stamina; myFile>>hp; ...
I think i cannot use the same txt file name.
Is that another method to do that?