1 // The equivalent to python dictionaries are maps in c++
2 map<int, char> mymap; // Enter required types and name
3 mymap[1] = 'a';
4 mymap[4] = 'b';
5 cout << "my map is -" << mymap[1] << " " < <mymap[4] << endl;
1#include <map>
2
3std::map<char, char> my_map = {
4 { 'A', '1' },
5 { 'B', '2' },
6 { 'C', '3' }
7};