How to save a game

I made this game but what I want to do now is save it so I can come back and play it again, but I do't know how to do that so if anyone can help then thanks.
Save whatever info you need into a text file and then just give the option to load all of the info from that file the next time you start (the type of data depends on the game obviously).

http://www.cplusplus.com/reference/fstream/fstream/
Write the state of the game to a file. When the user restarts the game, load the file to restore the state of the game. Pretty straight forward if you're using classes.

For example, if you have a Game class along with two Player instances, simply write those three objects to a file. When you restart, initialize the Game class and the two player instances from the data saved in the file.
thanks !
Topic archived. No new replies allowed.