fork download
  1. #include <iostream>
  2. #include <map>
  3.  
  4. int main() {
  5. std::map<char, int> map = {
  6. { 'a', 1 },
  7. { 'b', 2 }
  8. };
  9.  
  10. for (auto &element : map) {
  11. std::cout << element.first << " -> " << element.second << '\n';
  12. }
  13. return 0;
  14. }
Success #stdin #stdout 0s 3472KB
stdin
Standard input is empty
stdout
a -> 1
b -> 2