Count Games Played and Store Value !

I am trying to figure out how to implement a game count for file out put and am running into problems. Can you tell me how to get the number to be stored between running the program? I have got it counting and incrementing properly but when I exit debugging and then go back in again the count starts over at 1 again.

I declared the variable that is used to track it as a static int in main.
Static only works each time it is open ex:
static int starts at 1 and gets incremented each time function is called ends at 5 then you close program it will be back at 1 when you open the program.
What you can do is read from a file for the initial value then write to the file when you close the program and that will keep the updated value.
Topic archived. No new replies allowed.