zoukankan      html  css  js  c++  java
  • c++ map 使用

    . 包含头文件:

    1 #include <map>

    2. 构造函数:

    1   std::map<char,int> first;
    2   first['a']=10;
    3   first['b']=30;
    4   first['c']=50;
    5   first['d']=70;
    6   std::map<char,int> second (first.begin(),first.end());
    7   std::map<char,int> third (second);

    3. 添加元素:

    4. 查找元素:

    5. 删除元素:

    6. member functions:

        map::at
        map::begin
        map::cbegin
        map::cend
        map::clear
        map::count
        map::crbegin
        map::crend
        map::emplace
        map::emplace_hint
        map::empty
        map::end
        map::equal_range
        map::erase
        map::find
        map::get_allocator
        map::insert
        map::key_comp
        map::lower_bound
        map::max_size
        map::operator=
        map::operator[]
        map::rbegin
        map::rend
        map::size
        map::swap
        map::upper_bound
        map::value_comp

  • 相关阅读:
    centos5&6的启动过程
    linux之目录知识
    js动画
    js操作高级
    js操作
    JS基础
    跨域问题
    MySQL存储引擎
    MySQL索引管理
    MySQL操作命令
  • 原文地址:https://www.cnblogs.com/sarah-zhang/p/6254841.html
Copyright © 2011-2022 走看看