C++ hash_map小例子

#include <vector>
#include <boost/progress.hpp>
#include <Windows.h>
#include <map>
#include <iostream>

#include <hash_map>

#include "CSHOW.H"
using namespace boost;
using namespace std;

int main()
{
 hash_map<string, int> student;
 student.insert(pair<string, int>("ganquanfu" ,98));
 student.insert(pair<string, int>("zhouxiaojie" ,88));

 //cout << student["ganquanfu"] << endl;
 //cout << student["zhouxiaojie"] << endl;

 hash_map<string, int>::iterator hpItem;
 for (hpItem = student.begin(); hpItem != student.end(); ++hpItem)
 {
  cout << hpItem->first << "  " << hpItem->second << endl;
 }
 
 int wait;
 cin >> wait;
}

 

原文链接: https://www.cnblogs.com/ganquanfu2008/p/3161718.html

欢迎关注

微信关注下方公众号,第一时间获取干货硬货;公众号内回复【pdf】免费获取数百本计算机经典书籍

    C++ hash_map小例子

原创文章受到原创版权保护。转载请注明出处:https://www.ccppcoding.com/archives/93817

非原创文章文中已经注明原地址,如有侵权,联系删除

关注公众号【高性能架构探索】,第一时间获取最新文章

转载文章受原作者版权保护。转载请注明原作者出处!

(0)
上一篇 2023年2月10日 上午2:20
下一篇 2023年2月10日 上午2:20

相关推荐