I want to store data that looks like this:
NAME SURNAME BIRTHDATE
eg:
{{"Anna", "Smith", "16/06/1965"}
{"Bob", "Smith", "26/07/1982"}}
I think I can make a struct myself like this
struct PEOPLE {
string name;
string surname;
string birthdate;
};
But is there any data structure I can use for this purpose? Like where a name is a key and surname and birthdates are values?
You can always have something like:
using Key = std::string;
using Value = std::pair<std::string, std::string>;
and use it like:
using HumanBeing = std::pair<Key, Value>;
or:
std::map<Key, Value>
Of course, aliases are not that necessary:)
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.