读书人

C++ Builder 中如何使用Hash_地图,has

发布时间: 2013-06-25 23:45:42 作者: rapoo

C++ Builder 中怎么使用Hash_map,hash_set


#include <hash_map>
#include <map>
#include <vector>
#include <Generics.collections.hpp>
#include <iostream>

hash_map<const char*, int, hash<const char*>, eqstr> months;

months["january"] = 31;
months["february"] = 28;
months["march"] = 31;
months["april"] = 30;
months["may"] = 31;
months["june"] = 30;
months["july"] = 31;
months["august"] = 31;
months["september"] = 30;
months["october"] = 31;
months["november"] = 30;
months["december"] = 31;


编译报错 hash_map报错。
[解决办法]
在help中一搜THashedStringlist不就马上有结果了嘛
inifiles.hpp
[解决办法]
没有加名字空间
using namespace std;

读书人网 >C++ Builder

热点推荐