in my function, i have this parameter:
map<string,int> *&itemList
I want to first check if a key exists. If this key exists obtain the value. I thought this:
map<string,int>::const_iterator it = itemList->find(buf.c_str());
if(it!=itemList->end())
//how can I get the value corresponding to the key?
is the correct way to check whether the key exists?