map使用实例
#include "hptime.h"
#include <iostream>
#include <Windows.h>
#include <time.h>
#include <string>
#include <cmath>
#include <map>
using namespace std;
int main()
{
map<string, string> mapDatas;
mapDatas["001"] = "liang";
mapDatas["002"] = "ganquanfu";
map<string, string>::iterator iterMap = mapDatas.find("002");
if(iterMap != mapDatas.end())
{
cout << iterMap->first.c_str() << " " << iterMap->second.c_str() << endl;
//输出002 ganquanfu
}
int wait;
cin >> wait;
return 0;
}