Python dict = Hashmap. C++ dùng std::map hoặc std::unordered_map.
Ví dụ C++ map
#include#include
Kết quả: in các cặp key=value. Tương đương Python {'a':1, 'b':2, ...}.
Lưu ý: C++ map là ordered (RB-tree), unordered_map mới là hash table như Python dict.