Question: This is the insert function of Hashtable in C. I think my code is correct, but it says that I have a segmentation fault. How

This is the insert function of Hashtable in C.
I think my code is correct, but it says that I have a segmentation fault. How do I fix it?
void ht_put (hashtable_t ht, char xkey, void val) FIXME: the current implementation doesn't update existing entries / unsigned int idx-: hash(key) % ht->size; bucket t *bmalloc(sizeof (bucket t)) while (b) if (strcmp (b->key, key) 0) ht->buckets [idx]=val; return; b->val=val ; b->key key; b->next ht->buckets [idx]; ht->buckets [idx]b
Step by Step Solution
There are 3 Steps involved in it
Get step-by-step solutions from verified subject matter experts
