for auto map c

Solutions on MaxInterview for for auto map c by the best coders in the world

showing results for - "for auto map c"
Gemma
28 Jul 2017
1//Since c++11
2for (const auto& kv : myMap) {
3    cout << kv.first << " has value " << kv.second << endl;
4}
5//Since c++17
6for (auto& [key, value]: myMap) {
7    cout << key << " has value " << value << endl;
8}
similar questions
queries leading to this page
for auto map c