So I just finished my first class in C++ and I have really enjoyed programming. I have begun to create programs of my own, but I feel that there is one aspect that is severely limiting my options. What are some methods of saving data so that you can start where you left off the next time you run the program.
The first thought that I had was saving everything to a file, but I don't know how practical that would be.
If there are any other methods, or if that is a viable method, I would love to know.
Your first thought was correct, but there are several ways to do that. Let's take a configuration file for example. Usually you see something like option1 = "value1"
but you could also do
1 2 3
value1
value2
value3
.
In the first case you read the option and assign the value to the associated variable, in the second case you will read them in sequence and will need to assign them in that order without the ability to use a default value if an option isn't specified (because you can't know which one is missing).