Quick Question about C++ Maps (reply fast if possible)

i have declared a map in map but i cannot access it,
this is the declaration:
map<map<string,int>,string> op;
no errors in declaration. but when i try to access it for example
op["text 1"][0] = "text 2";
'[' have red underline saying "[" no operator found which takes a right-hand operand of type 'const char [9]' (or there is no acceptable conversion)
whats wrong?

whats wrong?
The first template argument is the key type. The second template argument is the value type. It looks like you have put them in the opposite order.
got it .. changed to map<string,map<int,string>> op;

and now works like i wanted .. tnx .. i messed up there :D
Topic archived. No new replies allowed.