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
时间: 2024-12-17 12:06:43