lundi 25 septembre 2017

how to insert two hash in one hashmap

i have 2 struct one is key and other is value

struct  abc
{
 string a;
 string b;
}
struct  xyz
{
 string x;
 string y;
}

i want a map like below

map<abc,xyz[]> myhash;

i need to access data from hash like

myhash.first.a;
myhash.first.b;
myhash.second[1].x;

myhash.first.a;
myhash.first.b;
myhash.second[2].x;
myhash.second[2].y;

Explanation: i have two fields to be use as a key, and that contains multiple values so value structure is a array.

i am new to c++.

i can not write full code here but this is just a concept i need to clear so i can use this solution in my code.

Aucun commentaire:

Enregistrer un commentaire