Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Interacting with a simple database in c++?

Tags:

c++

database

I'm making a game in c++ that will need to store and retrieve information about players (name, email, high score) etc. I thought of trying to just do it myself with XML but I think a real database (maybe SQL?) would do a better job since over time there may be thousands of users.

Are there libraries to do simple interactions with databases like queries, retrieving information, and storing information?

Thanks

like image 838
jmasterx Avatar asked Mar 20 '26 10:03

jmasterx


2 Answers

Yes, SQLite will do exactly this. It stores the database as a local file, so if you want an online database server then this is perhaps not the best option.

like image 162
Graham Borland Avatar answered Mar 22 '26 00:03

Graham Borland


It sounds like sqlite might be a good fit for you. It doesn't need a constantly running database server, and it does things smarter than hand-rolled xml-serialization.

Sqlite has documentation.

like image 36
Magnus Hoff Avatar answered Mar 21 '26 23:03

Magnus Hoff



Donate For Us

If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!