1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18
|
// multimap::begin/end
#include <iostream>
#include <map>
int main ()
{
std::multimap<char,int> mymultimap;
mymultimap.insert (std::pair<char,int>('a',10));
mymultimap.insert (std::pair<char,int>('b',20));
mymultimap.insert (std::pair<char,int>('b',150));
// show content:
for (std::multimap<char,int>::iterator it=mymultimap.begin(); it!=mymultimap.end(); ++it)
std::cout << (*it).first << " => " << (*it).second << '\n';
return 0;
}
| |