Please check the below code

#include
#include
#include
using namespace std;
int main()
{
// it is possible to have same keys
multimap<char,string> mp;
int n;
cin>>n;
for(int i=0;i<n;i++)
{
char ch;
string s;
cin>>ch>>s;
mp.insert(make_pair(ch,s));
}

// search 
auto f=mp.find('c');
if(f->second=="cat"){
    mp.erase(f);
}

for(auto it=mp.begin();it!=mp.end();it++)
{
    cout<<mp->first<<" "<<mp->second<<endl;
}

}
// it is giving error

it should be it->first and it->second

for (auto it = mp.begin(); it != mp.end(); it++)
    {
        cout << it->first << " " << it->second << endl;
    }

I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.

On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.