STL Map使用
来源:互联网 发布:微信支付php 完整源码 编辑:程序博客网 时间:2024/06/05 16:38
/*description:STL map使用author:Jasondate:20160521*/#include<stdio.h>#include <map>#include<iostream>using namespace std;int main(){ map<char,int> mymap; int data[]={31,-41,59,26,-53,58,97,-93,-23,84,33,22}; int len=sizeof(data)/sizeof(data[0]); cout<<"len="<<len<<endl; for (int i=0;i<len;i++) { mymap.insert(pair<char,int>(char('a'+i),data[i])); } map<char,int>::iterator it; for (it=mymap.begin(); it!=mymap.end(); ++it) { cout << it->first <<" -> "<<it->second<<endl; } cout<<endl; cout<<"max_size:"<<mymap.max_size()<<endl; return 0;}
insert Insert elements (public member function )
erase
Erase elements (public member function )
swap
Swap content (public member function )
clear
Clear content (public member function )
emplace
Construct and insert element (public member function )
emplace_hint
Construct and insert element with hint (public member function )
0 0
- STL map使用详解
- STL map使用
- STL Map使用示例
- STL map使用
- C++ STL Map使用
- stl 复习:map使用
- STL中map使用
- stl::map使用小结
- STL map的使用
- map 的使用【STL】
- STL map使用
- stl map基本使用
- STL map的使用
- STL map的使用
- c++ STL map 使用
- STL map的使用
- STL Map使用
- STL map使用详解
- windows下git添加文件时,LF will be replaced by CRLF in test.txt.
- EF原理
- Mac、Windows下Android Studio快捷键的使用
- (创建型模式)ABSTRACT FACTORY——抽象工厂模式
- (创建型模式)SINGLETON——单例模式
- STL Map使用
- Android AsyncTask的使用(1)
- 基于FS4412嵌入式系统移植(4) u-boot移植与指令添加
- codeforces_672C. Recycling Bottles(贪心)
- retrofit2、RxJava简单使用总结
- (结构型模式)BRIDGE——桥模式
- CppUnit入门
- 练习三1003
- (行为模式)COMMAND——命令模式