迭代器之map的简单介绍
来源:互联网 发布:淘宝客服名称 编辑:程序博客网 时间:2024/05/28 15:07
#include<iostream>
#include<string>
#include<map>
using namespace std;
//typedef map<int,string> UDT_MAP_INT_STRING;
//UDT_MAP_INT_STRING enumMap;
int main()
{
cout<<"........"<<endl;
map<int,string> enumMap;
enumMap.insert(pair<int,string>(1,"student_one"));
enumMap.insert(pair<int,string>(2,"student_two"));
enumMap.insert(pair<int,string>(3,"student_third"));
enumMap.insert(pair<int,string>(3,"student_third"));
enumMap.insert(pair<int,string>(3,"student_third"));
enumMap.insert(pair<int,string>(3,"student_third"));
map<int,string>::iterator iter;
for(iter=enumMap.begin();iter!=enumMap.end();iter++)
{
cout<<iter->first<<""<<iter->second;
cout<<""<<endl;
}
getchar();
}
#include<string>
#include<map>
using namespace std;
//typedef map<int,string> UDT_MAP_INT_STRING;
//UDT_MAP_INT_STRING enumMap;
int main()
{
cout<<"........"<<endl;
map<int,string> enumMap;
enumMap.insert(pair<int,string>(1,"student_one"));
enumMap.insert(pair<int,string>(2,"student_two"));
enumMap.insert(pair<int,string>(3,"student_third"));
enumMap.insert(pair<int,string>(3,"student_third"));
enumMap.insert(pair<int,string>(3,"student_third"));
enumMap.insert(pair<int,string>(3,"student_third"));
map<int,string>::iterator iter;
for(iter=enumMap.begin();iter!=enumMap.end();iter++)
{
cout<<iter->first<<""<<iter->second;
cout<<""<<endl;
}
getchar();
}
先把代码贴出来,随后进行深入了解
0 0
- 迭代器之map的简单介绍
- 简单介绍Struts2的数据中心 ---context map
- map简单介绍
- Map简单介绍
- STL之MAP的详细使用介绍
- stl之map介绍
- 介绍iBATIS的SQL Map的简单例子
- map的详细介绍及简单的运用
- 简单介绍Struts2的数据中心 ---context map中的根ValueStack
- STL的map介绍
- map.entry的介绍
- Hadoop之map/reduce介绍
- IOS之UIPickerView的使用简单介绍
- Android之SurfaceView的简单介绍
- Mysql之索引的简单介绍
- OrangeUI之ListView的简单介绍
- Java面试之数据结构的简单介绍
- map/reduce、列表生成器简单介绍
- 自定义组合控件的步骤
- Juery 遍历某个方法,使其自动执行多次
- Linux菜鸟的入门-终端环境中C语言编程
- 条件语句和循环
- CF509E:Pretty Song(规律,前缀和)
- 迭代器之map的简单介绍
- 实时监听input值的改变
- 第1、2节-线性规划、梯度下降和正规方程组
- [51nod 1184]第N个质数
- File类
- openCV中访问图像像素的两种方法
- 17 - 03 - 24 图解HTTP(28)
- 顺序表应用7:最大子段和之分治递归法
- 让你脑洞大开的MySQL优化技巧