It looks like you are looking for:
std::vector<std::map<std::string, int> > myData1;
or perhaps:
std::map<int, std::map<std::string, int> > myData2;
First you need to resize the vector to the appropriate size before using the indexing operators:
myData1.resize(100);
myData1[25]["hello"] = 7;
... and the second will allow you to assign any element directly (and rarely):
myData2[25]["hello"] = 7;
source
share