Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. Diference between hash_map and hash_multi map. how to implement hash_multimap in VS2008 (for C++)

Diference between hash_map and hash_multi map. how to implement hash_multimap in VS2008 (for C++)

Scheduled Pinned Locked Moved C / C++ / MFC
questionc++visual-studiocryptographyhelp
3 Posts 2 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • N Offline
    N Offline
    Nandu_77b
    wrote on last edited by
    #1

    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

    _ 1 Reply Last reply
    0
    • N Nandu_77b

      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

      _ Offline
      _ Offline
      _AnsHUMAN_
      wrote on last edited by
      #2

      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_

      N 1 Reply Last reply
      0
      • _ _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_

        N Offline
        N Offline
        Nandu_77b
        wrote on last edited by
        #3
        1. 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
        1 Reply Last reply
        0
        Reply
        • Reply as topic
        Log in to reply
        • Oldest to Newest
        • Newest to Oldest
        • Most Votes


        • Login

        • Don't have an account? Register

        • Login or register to search.
        • First post
          Last post
        0
        • Categories
        • Recent
        • Tags
        • Popular
        • World
        • Users
        • Groups