i'm working on a small project where i'm storing student details in an array of structures.The admin logs in to modify these details.How do i get this data to remain permanent?(i.e the data entered should not be erased every time i re-open the program)

Is there no way other than using the concept of files?If the answer is no,please tell me how to do it with files.

7 Years
Discussion Span
Last Post by skydust

You will need either files or a database (such as MySQL).

Your application stores all the data it requires at runtime in RAM. RAM is known as volatile memory, because once you remove power to the device, it resets. This is intrinsic to the electronics and cannot be changed.

The reason your program "forgets" everything after you close and re-open it, is because your application runs in its own little block of memory and the Program/Operating System cleans it up when the application closes. Failure to do so is a memory leak. RAM is not meant to be used as permanent storage. That's what the HDD is for.

To learn about files, look at the fstream and iostream headers. If you want something more OS Specific, you will need to Google it =)


Which are files :icon_rolleyes:

Semantics! I was making a differentiation between storing it directly to a file, or using an existing database engine ;)

Edited by Ketsuekiame: n/a


thanks :icon_smile:...i'll try working on it using files

This topic has been dead for over six months. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.