2 Questions, 1: Databases, 2: In-app Memory?

With the older programming languages such as BASIC (and lot others i cant think of right now) a lot of tutorials began by explaining the basics, and then showing you how to make a database... Because at the time that was the most useful things the languages did.
However i'm wondering what the most ideal way to do this in C++ would be? I dont know how the older languages stored there data but i know there are various ways in C++ and i was wanting opinions on which would be the best methods?

P.S a second question i was gonna ask later would be, Is there any way to store data IN app that is saved even when app is closed and reloaded?
then showing you how to make a database... However i'm wondering what the most ideal way to do this in C++ would be?


If you're talking about a SQL or similar style of database, that can be done with any one of a dozen database libraries that are available. Which you use depends on what kind of database you want.

Though, personally, I'd say that C++ is not an ideal language for database work, IMO. The DB libs I've used were all clunky and awkward to use because they had to deal with C++'s strict type system. Databases tend to just be easier to work with in dynamically typed languages.


Is there any way to store data IN app that is saved even when app is closed and reloaded?


That is typically done by writing the information to a file, then loading that file on program startup.
I had a feeling that saving information to a file that's loaded on startup would be the only way to in effect store data 'in app'.

Because user directories change with each computer i thought of using the %appdata% directory which is automatically detected by the system for which-ever user is logged on...
However the fstream cannot create a text document in here and i'm not quite sure if you can do it with system() either as i've searched the cmd help and can't find anything that creates a file if non-existent.
Topic archived. No new replies allowed.