现在的位置: 首页 > 综合 > 正文

[转] STL multimap 使用

2013年10月02日 ⁄ 综合 ⁄ 共 1542字 ⁄ 字号 评论关闭

看了好多关于STL multimap的使用方法,但就这个还是较简洁。现转过来,算是笔记吧:

 

 

结果:

Compile: g++ testMultimap.cpp 
Run: ./a.out

Number of elements with key a: 2
Number of elements with key b: 3
Number of elements with key c: 1
Elements in m:
[a, 1]
[a, 5]
[b, 3]
[b, 4]
[b, 6]
[c, 2]

Range of "b" elements:
[b, 3]
[b, 4]
[b, 6]

来源:http://www.yolinux.com/TUTORIALS/CppStlMultiMap.html

抱歉!评论已关闭.