my question is that I have made multimap.Here is the partial code.
if(binary_search(final.begin() , final.end() , answer ) )
{
final[answer] =
}
else
{
final.insert(pair<string,int>(answer , 1 ) );
}
Here answer is a string and final is a multimap of <string,int>
. Now what I want is that if the string answer is present then increment(modify) the value of int. How can I do this?
I want to increment the value of int by one if the string element is already present?
Regards.