map
来源:互联网 发布:斑竹网络意思 编辑:程序博客网 时间:2024/06/05 11:32
1. map 插入元素
map<long long,string> list;
pair< map<long long,string>::iterator, bool> ret = list.insert(map<long long,string>::value_type(1,"haah") );if (ret.second)
cout << "insert succeed" <<endl;
list.insert(pair<long long,string>(2,"xixi") );
2. 查找删除
map<long long,string>::iterator iter = list.find(2);
if (iter == list.end())
cout << "can't found";
else
cout << "key:"<<iter->first<<" value:"<<iter->second<<endl;
list.erase(iter); //或者 list.erase(2); 直接删2
- map
- MAP
- map
- MAP
- map
- map
- map
- Map
- Map
- Map
- map
- map
- Map
- .map
- map
- MAP
- map
- Map
- PHP abstract 和 interface的区别
- C++几处代码优化记录
- Panda3d编译
- cov-analyze
- monodb 与sql语法对比
- map
- PHP简单分页类
- 解决浏览器兼容性问题
- opencv 实现图像的旋转
- 职业生涯遇到瓶颈----求教高人,拨云见日
- window.onload 加载完毕的问题及解决方案(上)
- POJ 1986 Distance Queries(在线LCA)
- window.onload 加载完毕的问题及解决方案(下)
- GDB 基本知识