C++ multimap

2021. 3. 26. 15:20·SW개발/C++
반응형

multimap

  • <map> 라이브러리

예제

  • key가 중복이 될 수 있는 map이다.

    #include <iostream>
    #include <map>
    
    int            main()
    {
      using namespace std;
    
      multimap<char, int> map;
    
      map.insert(std::pair<char, int>('a', 10));
      map.insert(std::pair<char, int>('c', 50));
      map.insert(std::pair<char, int>('b', 20));
      map.insert(std::pair<char, int>('a', 100));
    
      cout << map.count('a') << endl;
    
      for (auto& e : map)
        cout << e.first << ' ' << e.second << '\n';
    }
    
    /* stdout stderr
    2
    a 10
    a 100
    b 20
    c 50
    */
반응형
저작자표시 (새창열림)

'SW개발 > C++' 카테고리의 다른 글

C++ STL 알고리즘 (Algorithms)  (0) 2021.03.26
C++ STL 반복자 (Iterators)  (0) 2021.03.26
C++ map  (0) 2021.03.26
C++ multiset  (0) 2021.03.26
C++ set  (0) 2021.03.26
'SW개발/C++' 카테고리의 다른 글
  • C++ STL 알고리즘 (Algorithms)
  • C++ STL 반복자 (Iterators)
  • C++ map
  • C++ multiset
Caniro
Caniro
  • Caniro
    Minimalism
    Caniro
  • 전체
    오늘
    어제
    • 전체보기 (318)
      • SW개발 (268)
        • Java Spring (6)
        • C++ (186)
        • Python (21)
        • Linux (16)
        • 알고리즘 (13)
        • Git (4)
        • Embedded (1)
        • Raspberrypi (9)
        • React (3)
        • Web (2)
        • Windows Device Driver (6)
      • IT(개발아님) (45)
        • Windows (25)
        • MacOS (7)
        • Utility (11)
      • 챗봇 짬통 (0)
      • 일상 (2)
  • 블로그 메뉴

    • 홈
    • 태그
    • 방명록
  • 링크

  • 공지사항

  • 인기 글

  • 태그

    MacOS
    citrix workspace
    windows
    SunOS 5.1
    SFC
    logi options
    제외
    맥북 카카오톡 알림 안뜸
    dism
    spring
    스프링 프레임워크 핵심 기술
    java
    Workspace
    Solaris 10
    로지텍 마우스 제스처
    윈도우 명령어
    vscode
    알림
    그림판
    Windows 11
    스프링
    mspaint
    KakaoTalk
    시스템 복구
    백기선
    윈도우
    EXCLUDE
    unix
  • 최근 댓글

  • 최근 글

  • hELLO· Designed By정상우.v4.10.3
Caniro
C++ multimap
상단으로

티스토리툴바