+ 10
C++ (using files as database)
How can i permanently create a file and store things to it every time it runs and will still be accessible later in --C++
2 Respostas
+ 9
Once you create a file it will be permanently saved.
+ 1
I just want to complement the answer of Dark Angel.
If you want to use a file as db, C++ class fstream and the related ones offer many options: for example you can have a text file or a binary file (with this one you can save your objects directly), you can open a file only for reading/writing or both, the new content can be appended at the of the file, etc...
As an example, see this code:
https://code.sololearn.com/czgs0L9Om9WY/?ref=appt
You will need to execute it on your machine to watch the file being modified.
I also recommend as reading: http://www.cplusplus.com/doc/tutorial/files/
Good coding.