View Full Version : Hash Maps in C

January 28th, 2010, 06:16 AM
Hey guys, does anybody know what the standard practice is for getting hash maps in C? I use the STL in C++ and Python has the dictionaries, but I can't find any agreed upon solution for C.

January 28th, 2010, 07:06 AM
A while ago I was searching for something similar, dunno if this is what you need, You can take a look though :D


January 28th, 2010, 07:21 AM
Thanks! Its certainly not as pretty to use as hash functions in other languages, but its better than nothing.

January 28th, 2010, 08:45 AM
there is no real agreed practice, as the C standard does not contain any complex containers, nor does it set any requirements/recommendations on what a good implementation is.

glib's hash table:

uses tons of macros to make it reasonably easy to use, bsd license:

this one that looks quite sophisticated but I never used it. You should probably read the licesne before considering to use it.

January 28th, 2010, 04:19 PM
Thank you very much for answering! I guess I'll have to do some experimenting.