Logo

Programming-Idioms

History of Idiom 13 > diff from v32 to v33

Edit summary for version 33 by :
New Cpp implementation by user [GhassanPL]

Version 32

2016-02-16, 16:58:54

Version 33

2016-02-16, 18:28:18

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Idiom #13 Iterate over map keys and values

Print each key k with its value x from an associative array mymap

Imports
#include <iostream>
Code
for (const auto& kv: mymap) {
	std::cout << "Key: " << kv.first << " Value: " kv.second << std::endl;
}