c - Chained hash-table declaration -


in master algorithm c, author has declared structure of chained hash table below:

typedef struct chtbl_ {  int                buckets;  int                (*h)(const void *key); int                (*match)(const void *key1, const void *key2); void               (*destroy)(void *data);  int                size; list               *table;  } chtbl; 

but thought last 1 should list *table[buckets]; author has used &htbl->table[bucket]. right? why author's definition correctly pass test?why right? thank you!

the table list pointer, , being used represent array of lists. being initialized this:

htbl->table = malloc(sizeof(list) * htbl->buckets); 

Comments

Popular posts from this blog

.htaccess - First slash is removed after domain when entering a webpage in the browser -

Automatically create pages in phpfox -

c# - Farseer ContactListener is not working -