map集合的插入数据中,操作下标插入最直观,企业中经常使用,但是又两个问题要注意
1)插入数据为重复key的话,会把原来值覆盖,
map<int,string> map1;
map1.insert(make_pair(2,"s"));
map1[2] = "22";
map<int, string>::iterator it = map1.begin() ;
for(;it!= map1.end();it++)
{
cout<< it->first <<"+++++++" <<it->second<<endl;
}