Skip to content

hdel

Category: hash
GitHub: cute_hashtable.h


Removes an item from the table.

#define hdel(h, k) cf_hashtable_del(h, k)
Parameters Description
h The hashtable. Can be NULL. Needs to be a pointer to the type of items in the table.
k The key for lookups. Each {key, item} pair must be unique. Keys are always typecasted to uint64_t e.g. you can use pointers as keys.

Code Example

Removes an item in the table.

htbl CF_V2 table = NULL;
hadd(table, 10, cf_v2(-1, 1));
hdel(table, 10);
hfree(table);

Remarks

Asserts if the item does not exist.

htbl
hset
hadd
hget
hfind
hget_ptr
hfind_ptr
hhas
hfree
hclear
hkeys
hitems
hswap
hsize
hcount