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

std::map

时间:2015-09-05 09:52:55      阅读:144      评论:0      收藏:0      [点我收藏+]

标签:

map<int,string> m_mapTest;
m_mapTest.insert(make_pair(1,"kong"));
m_mapTest.insert(make_pair(2,"yang"));
m_mapTest.insert(make_pair(1,"hello1"));
m_mapTest.insert(make_pair(3,"hello3"));
m_mapTest.insert(make_pair(2,"hello2"));

map<int,string>::iterator it = m_mapTest.begin();
for(;it!=m_mapTest.end();it++)
{
string sTem = (*it).second;
::OutputDebugString(sTem.c_str());
::OutputDebugString("\n");
}

输出结果:

kong
yang
hello3

std::map

标签:

原文地址:http://www.cnblogs.com/justkong/p/4782750.html

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