0
Can someone help me out?, I'm writing a c++ program which is to read and store data of a file on the computer permanently.
Can someone help me out?, I'm writing a c++ program which is to read and store data of a file on the computer permanently, but it's not storing the data permanently but rather temporary, any help please, is there anyone to help me?
3 Réponses
+ 1
When you run your program, all of its data is stored in RAM temporarily until it ends, meaning when you run your program again, it'll start all over as if nothing has changed.
If you want your data to be stored permanently instead, you should use your drives such as SSD and HDD. That's where database mentality is coming from and reason behind why it exists.
You can simply store your data in files and read information from them when you run your program so it will look like your changes are saved when your program ends
0
Well write it into another file.
If you don't, it'll be stored in the memory allocated to your program, but once your program terminates, the said memory is freed and can be rewritten by any other program/process that needs it
0
In fact, if you want to store data permanently on your computer, you have to tell your computer to lend you some space on the drive and not to touch it anymore. It's like doing a reservation.
I don't know any other way to do that (and I don't think there are to be honest) than creating a file and saving it on the computer