all repos — hashtable @ 526176a0a3e01b21ec9de3f5f1876520d272c0b9

A very simple hashtable implementation in C

update readme
prithugoswami prithugoswami524@gmail.com
Thu, 07 Mar 2019 20:19:05 +0530
commit

526176a0a3e01b21ec9de3f5f1876520d272c0b9

parent

145aaa3e3e20dd56197b4713e1981b88c5dd1cdf

1 files changed, 23 insertions(+), 0 deletions(-)

jump to
M README.mdREADME.md

@@ -1,1 +1,24 @@

# hashtable +## Simple HashTable implementation + +Inserting Into the hastable can be done with: +`HashTableInsert(<key>, <value>, <hashtable pointer>);` + +Accessing the hastable can be done with: +`HashTableGet(<key>, <hashtable pointer>);` + +EXAMPLE USAGE: + +```c +HashTable *ht = createHashTable(100); +int rc = HashTableInsert("name", "Prithu", ht); +if(rc) + fprintf(stderr, "Cannot Insert the data into the Hashtable"); + +char *my_name = (char *)HashTableGet("name", ht); + +FILE *fp = fopen("my_file.txt", "r"); +HashTableInsert("file", fp, ht); + +FILE *my_file = (FILE *)HashTableGet("file", ht); +```