码迷,mamicode.com
首页 > 其他好文 > 详细

map容器的使用

时间:2016-10-23 12:18:55      阅读:206      评论:0      收藏:0      [点我收藏+]

标签:class   color   map容器   std   ccf   key   strong   pyw   get   

1、map是STL容器中的一种,属于关联性容器。
以key value的形式存储。key必须唯一。如果重复则插入失败。插入后按照key默认排序。必须要先声明命名空间

using namespace std;

2、例如:

#include<map>
#include<string>
using namespace std;
void main()
{
map<int,string>h;
}

map容器的使用

标签:class   color   map容器   std   ccf   key   strong   pyw   get   

原文地址:http://www.cnblogs.com/thunder-wu/p/5989233.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!