사용 목적
키가 전부 unique할 때, 'key-value'를 저장하는 자료구조가 필요할 때
헤더
#include <map>
map이 사용할 수 있는 함수들
map.find(키값)
if (m.find("Alice") != m.end()) { cout << "find" << endl; } else { cout << "not find" << endl; }
erase(키값)
m.erase("Alice");
clear()
m.clear(); //모든 요소 삭제
insert({ket, value})
m.insert({"Cam", 300}); //insert를 사용하지 않고 m["Cam"]++;로 접근시 value는 //자동으로 0으로 초기화되어 삽입되므로 연산결과 1이된다.
Reference
https://life-with-coding.tistory.com/305