Hi
I have to create a hash map with key as string and data as string. i have to create a custom hash function for the hash map, but i don't know how to do that.. can somebody explain and give an example from which i could understand?
existence19 0 Newbie Poster
Recommended Answers
Jump to PostFirst read up on what a good hash function should do, and choose a hash algorithm.
http://en.wikipedia.org/wiki/Hash_table#Hash_functionThen implement the hash function keeping in mind what C++ requires of the hash function.
For …
Jump to Post> I just didn't understand what this does
> std::unary_function< const std::string&, std::size_t >Google for std::unary_function, perhaps?
Might, just might, throw up results like this: http://www.sgi.com/tech/stl/unary_function.html
Jump to Post> Well I know what a unwary function is.
Good.
> I don't know why we use it here. What if we don't use it?
Read the third post in this thread once again; this time paying attention to the comment at line number six of the …
All 9 Replies
coolbeanbob 17 Junior Poster
vijayan121 1,152 Posting Virtuoso
existence19 0 Newbie Poster
chary8088 -3 Newbie Poster
vijayan121 1,152 Posting Virtuoso
raptr_dflo 48 Posting Pro
raptr_dflo 48 Posting Pro
existence19 0 Newbie Poster
vijayan121 1,152 Posting Virtuoso
Be a part of the DaniWeb community
We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.