MMM24's blog

By MMM24, history, 9 years ago, In English
How to create a Matrix indexed by strings ex( m["abc"]["xyz"]=1 ) .
I google about it and all i can find is array indexed by string .
  • Vote: I like it
  • 0
  • Vote: I do not like it

| Write comment?
»
9 years ago, # |
  Vote: I like it +1 Vote: I do not like it

Try this code:

#include <map>
...
map<string, map<string,int>> m;
m["abc"]["xyz"] = 1;
»
9 years ago, # |
  Vote: I like it 0 Vote: I do not like it
map<string, map<string, int>> _map

Is taht what you're looking for?