map<string,int>::iterator itr;
for(itr=phone.begin();itr!=phone.end();itr++)
{
cout<<"the name is" <<itr->first<<",";
cout<<"the phone number is"<<*(itr).second<<endl;
}
i am getting this error for the above code:
struct std::_Rb_tree_iterator<std::pair<const std::string, int> >' has no member named 'second'
for the second statement in the for loop.
please help.....
@ajh32
Thanks ya...its working..