#include
#include
using namespace std;
int main() {
//cout<<“Hello World!”;
map<string,int> m;
m[“ram”]=30;
cout<<m[“ram”]<<endl;
m.insert(make_pair(“krishna”,79));
for(auto it=m.begin();it!=m.end();it++)
cout<first<<" "<second<<endl;
m.erase(“ram”);
auto it=m.find(“krishn”);
cout<<m[“a”];
// cout<<it==m.end();
cout<first<<endl;
for(auto x:m)
cout<<x.first<<" "<<x.second<<endl;
}
here in below iterator, we can access by . operator but in above iterator loop I have to use -> operator for accessing the element .is there any difference in both of them? or what is the reason use different operators