STL Map使用

/*
description:
STL  map使用

author:Jason
date:20160521
*/
#include
#include 
#include
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="<for (int i=0;ichar,int>(char('a'+i),data[i]));
    }
    map<char,int>::iterator it;
    for (it=mymap.begin(); it!=mymap.end(); ++it)
    {
        cout << it->first  <<" -> "<second<cout<cout<<"max_size:"<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 )

你可能感兴趣的:(STL Map使用)