Answers for "how to iterater map of sets in c++"

C++
1

how to iterater map of sets in c++

map<string, set<string>> mp;
     for (auto const& pair : mp) {
         cout << pair.first << ": ";
         for (auto const& elem : pair.second) {
             cout << elem << ", ";
         }
         cout << "\n";
     }
Posted by: Guest on July-30-2021

Browse Popular Code Answers by Language