I need to create an array of head pointers.
typedef struct data_{
void *data;
struct data_ *next;
}data;
typedef struct buckets_{
data *data;
void *key;
}buckets;
typedef struct hash_table_ {
buckets **buckets_array;
} hash_table, *Phash_table;
Phash_table table_p;
table_p = (void *)malloc(sizeof(hash_table));
table_p -> buckets_array = (void **)malloc(sizeof(buckets buckets)*size);
/*Line #7*/
When I tried to compile I get this
hash.c:7:62: error: expected ')' before 'buckets'
hash.c:7:28: warning: assignment from incompatible pointer type [enabled by default]
I’m trying to get an array of buckets and each bucket will point to a linked list.
Am I on the right path?
You have a typo. I think you wanted to write