Hello everyone,
I have declared a map :
map<char,int> mymap;
and when I say
map["asdfsd"]=5;
it throws an error : 58: error: invalid conversion from `char*' to `char'
how can I get around this ? I mean having a string as a key and not just a single character ?
Thanks.
"asdfsd" is a char*, but the map is keyed on char.
yeah but i can't declare
map<char[20],int> so how can I do this, if it is possible ?
edit: nevermind I used string instead of char.
Last edited on
Why aren't you using std::string to hold strings?