| <<< Looking at a map | Index | map::find >>> |
Use iterators to specify items or ranges:
typedef map< string, int > MapT;
typedef MapT::const_iterator MapIterT;
MapT amap;
// Print out map contents in alphabetical order:
for ( MapIterT mit = amap.begin(); mit != amap.end(); ++mit ) {
cout
<< mit->first
<< " "
<< mi->second
<< endl
;
}
| <<< Looking at a map | Index | map::find >>> |