STL - 23 (hash_map - 4)

Youngmin Choi·2021년 6월 29일
0

STL

목록 보기
23/34
post-thumbnail

hash_map 사용법

  • hash_map은 표준 STL의 namespace와 다른 이름을 사용한다. 따라서 namespace를 선언할 때 실수하지 않게 조심해야 한다!


    헤더파일 :
    #include < hash_map >


    hash_map이 속한 namespace는 표준 STL과 다른 'stdext'이다.
    using namespace stdest;


    원 형 :
    hash_map < key자료형, value 자료형 > 변수이름;
    hash_map < int, float > hash1;
    hash_map < int, float >* hash1 < int, float >

    hash_map 컨테이너를 사용할 때는 거의 대부분 '추가/삭제/검색' 이렇게 3가지를 사용한다.
profile
Always, Continually, In all circumstance

0개의 댓글