Naralas
Naralas

Reputation: 1

Is there anyway to have a multi dimensional map?

I'm looking for a way to have a multi dimensional map in C++. It would be something like :

["Key1"]
         ["SubKey1"] = "Value"
         ["SubKey2"] = "Value"
["Key2"]
         ...

Upvotes: 0

Views: 267

Answers (2)

Johan Råde
Johan Råde

Reputation: 21368

You can use a

std::map<std::string, std::map<std::string, std::string>>

Upvotes: 2

quamrana
quamrana

Reputation: 39354

You can use a

std::map<std::vector<std::string>, std::string>

Upvotes: 1

Related Questions