multimap用法
来源:互联网 发布:百度bae域名404 编辑:程序博客网 时间:2024/06/05 08:29
#include <map>
#include <numeric>
#include <string>
// test multimap
multimap<string, string> a_multimap;
a_multimap.insert(make_pair("guopeng", "C++"));
a_multimap.insert(make_pair("guopeng", "algorithm"));
a_multimap.insert(make_pair("guopeng", "SU code"));
// method 1
typedef multimap<string, string>::size_type own_type;
own_type nums = a_multimap.count("guopeng");
multimap<string, string>::iterator mul_iter = a_multimap.find("guopeng");
for (own_type cnt = 0; cnt < nums; cnt++, mul_iter++) {
cout << "nums of guopeng: " << mul_iter->second << endl;
}
// mathod 2
typedef multimap<string, string>::iterator own_iter_type;
pair<own_iter_type, own_iter_type> pos = a_multimap.equal_range("guopeng");
while (pos.first != pos.second) {
cout << "guopeng: " << pos.first->second << endl;
pos.first++;
}
- multimap用法
- multimap用法
- STL::map,multimap用法
- multimap用法示例
- STL-multimap用法
- multimap用法示例
- Map与Multimap用法
- Multimap 用法简介
- multimap的用法
- multimap的用法示例
- map/multimap用法详解
- STL:map/multimap用法详解
- C++ STL multimap用法总结
- map与multimap的用法
- STL:map/multimap用法详解
- multimap
- multimap
- Multimap
- HTTP Request Processing in IIS
- 巨人网络的三道坑爹改错题
- C# 4.0 的新增特性
- android 加载图片轻松避免OOM(out of memory) 支持设置缓存大小,不再强制catch OOM
- Windows和Linux操作系统下Eclipse开发C/C++程序的代码提示
- multimap用法
- ext combobox 下拉框显示位置问题
- Android接收端口短信
- Linux中Kill进程的N种方法
- IOS开发之CFURLCreateStringByAddingPercentEscapes--URL 编码
- Linux下安装使用Solr
- Android ilbc 语音对话示范(五)接收端处理
- Flash 与 Flex 配合开发,flash 导出 swc 到 flex
- 重载、覆盖、多态与函数隐藏---2