My code at iterator not run properly and give error like auto int is not declared in this scope

#include
#include
#include<bits/stdc++.h>
using namespace std;
int main()
{
map<string,int>m;
//insert 1
m.insert(make_pair(“mango”,120));
pair<string,int>p;
p.first=“apple”;
p.second=100;
//insertion 2
m.insert§;
//insertion 3
m[“banana”]=100;
//search 2
string fruit;
cin>>fruit;
if(m.count(fruit))
cout<<“price is”<<" “<<fruit<<endl;
else
cout<<“could not find it”<<endl;
//erase the particular object
m.erase(fruit);
//updatae the price
string fruit1;
cin>>fruit1;
m[fruit1]=1000;
m[fruit1]+=22;
cout<<m[fruit1]<<endl;
//iterate over all the keys
for(auto it=m.begin();it!=m.end();it++)
{
cout<<it<<” “<first<<” “<second<<” “;
cout<<endl;
}
for(auto p:m)
{
cout<<p.first<<” "<<p.second<<endl;
}
}

Hi @AMIT_KUMAR,
refer to dis


Hope dis helps

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.