Comparison of programming languages (associative array): Difference between revisions

Content deleted Content added
m Ruby: <source lang=irb>
Rescuing 1 sources. #IABot
Line 44:
 
=== [[C (programming language)|C]] ===
There is no standard implementation of an associative array in C, but a 3rd party library with BSD license is available [https://web.archive.org/20071015024120/http://www.cl.cam.ac.uk:80/~cwc22/hashtable/ here]{{Dead link|date=October 2011}}, archived [https://web.archive.org/web/20101119053156/http://www.cl.cam.ac.uk/~cwc22/hashtable/ here], with the source code available [https://github.com/davidar/c-hashtable/ here]. [[POSIX]] 1003.1-2001 describes the functions <code>hcreate()</code>, <code>hdestroy()</code> and <code>hsearch()</code>.
 
Another 3rd party library, [http://uthash.sourceforge.net/ uthash], also creates associative arrays from C structures. A structure represents a value, and one of the structure fields acts as the key.