Associative arrays/Creation/C: Difference between revisions
Content deleted Content added
Add simple simple way to create hash tables in C |
→From Scratch: more values |
||
Line 5:
==From Scratch==
A hash table can be implemented with the following. Because of this example's simplicity, it comes with some restrictions on use and capabilities: It can't be resized automatically, if you try to insert more values than its capacity it will freeze, the hashing function is very simple, etc. All are fixable with additional logic or using a library:
<lang c>typedef struct {
|