Associative array/Iteration: Difference between revisions

Line 88:
}</lang>
 
An alternative version using <code>for_each</code> and lambda functions (available in{{works with|C++0x):11}}
<lang cpp>#include <map>
#include <algorithm>
Line 108:
cout << "key = " << p.first << ", value = " << p.second << endl;
});
return 0;
}</lang>
 
Anonymous user