What are the advantages/disadvantages in using std::map's interator or using [] operator?
For example:
Code:map<char,int> ht; cout<<ht['s']<<endl; ht['s']++; map<char,int>::iterator it = ht.find('s'); cout<<it->second<<endl;
What are the advantages/disadvantages in using std::map's interator or using [] operator?
For example:
Code:map<char,int> ht; cout<<ht['s']<<endl; ht['s']++; map<char,int>::iterator it = ht.find('s'); cout<<it->second<<endl;