Diference between hash_map and hash_multi map. how to implement hash_multimap in VS2008 (for C++)
-
Hi, What is the difference between hash_map and hash_multimap? Can you please help me in implementing hash_multimap in VS 2008 (for C++) with Key as const char* Value as Class (some class say mycalss). After implementation how to insert the values? Thanks, nandu
-
Hi, What is the difference between hash_map and hash_multimap? Can you please help me in implementing hash_multimap in VS 2008 (for C++) with Key as const char* Value as Class (some class say mycalss). After implementation how to insert the values? Thanks, nandu
hash_map[^] & hash_multimap[^]. You will find an example for using hash_multimap in the link provided. On similar lines you can use the key as const char*
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
-
hash_map[^] & hash_multimap[^]. You will find an example for using hash_multimap in the link provided. On similar lines you can use the key as const char*
You need to google first, if you have "It's urgent please" mentioned in your question. ;-)_AnShUmAn_
- I tried the below and got the error: ommb.h(398) : error C2065: 'hash' : undeclared identifier #include #include //maha using namespace std; //maha using namespace stdext; //maha struct eqstr { bool operator()(const char* s1, const char* s2) const { return strcmp(s1, s2) == 0; } }; typedef hash_multimap, eqstr> map_type; void lookup(const map_type& Map, const char* str) { cout << str << ": "; pair p = Map.equal_range(str); for (map_type::const_iterator i = p.first; i != p.second; ++i) cout << (*i).second << " "; cout << endl; } 2) then i tried changing the type def to typedef hash_multimap test; and below is the error: error C2903: 'rebind' : symbol is neither a class template nor a function template C:\Program Files\Microsoft Visual Studio 9.0\VC\include\xhash(148) : see reference to class template instantiation 'stdext::_Hmap_traits<_Kty,_Ty,_Tr,_Alloc,_Mfl>' being compiled with [ _Kty=const char *, _Ty=CCommNode *, _Tr=functorHashString, _Alloc=functorEqualStrings, _Mfl=true ] C:\Program Files\Microsoft Visual Studio 9.0\VC\include\hash_map(182) : see reference to class template instantiation 'stdext::_Hash<_Traits>' being compiled with [ _Traits=stdext::_Hmap_traits Can any please help me where i am going wrong. Thanks, Nandu