Keeping high score

Hello, I'm new to coding and I have to make a game where it has to keep the best score after playing it a couple times, how do I do this? I already have the code for the game, I just don't know what to do to make it store the best score.

If you need to store it between runs of the program then just write it to a file when you exit the program and read it back in when you start.
how do i do this? with a function?
Input/Output with files:
http://www.cplusplus.com/doc/tutorial/
no like how do i store the scores and then put out the lowest score after the user plays the game a couple times
use fstream. and write the score to a file then use that file as input to ask for the score and if your new score is greater than rewrite the file to store the new best score
Topic archived. No new replies allowed.