Implement a hash table

后端 未结 3 1998
挽巷
挽巷 2020-12-28 10:42

I\'m trying to create an efficient look-up table in C.

I have an integer as a key and a variable length char* as the value.

I\'

3条回答
  •  醉酒成梦
    2020-12-28 10:49

    Declare the value field as void *value.

    This way you can have any type of data as the value, but the responsibility for allocating and freeing it will be delegated to the client code.

提交回复
热议问题