JT White
JT White

Reputation: 517

How can I store data in C++ and make the data searchable?

I'm working on an Address Book application in C++. I need to store the data and be able to retrieve it later. I know this requires serialization. I know how to serialize a simple map with a key and value.

I need to know how to store a lot of data, more than just one value. I will be storing: Name, Street Address, City, State, Zip Code, Personal E-mail, Work E-mail, Home Phone, Cellular Phone, Work Phone, Pager, Facebook, and Twitter. I would like to be able to search for any of these values in order to find a contact.

How can I go about storing all of this? Any help is greatly appreciated!

Upvotes: 1

Views: 487

Answers (2)

Scott Chamberlain
Scott Chamberlain

Reputation: 127603

What you will need is a some form of small database to be distributed with your application. See this SO question for some possible choices (Including SQLite like Bart suggested).

Upvotes: 1

Bart
Bart

Reputation: 20048

You might want to go with something like SQLite. It will allow you to store your data in an SQL database that you can query for whatever information you want out of it.

Upvotes: 6

Related Questions