I am trying to build a hash table, using the following node and table:
typedef struct Node {
int key;
int value;
int status;
} Node;
typedef struct Table {
int size;
Node* node;
} Table;
node in struct Table is a Node pointer so I thought hasht(Table*)->node would be a Node*. I tried to initialize all the node* in the table to NULL like this:
for(int i=0;i<hasht->size;i++)
{
hasht->node[i]=NULL;
}
However, when I compile the code it give me this error:
" incompatible types when assigning to type ‘Node {aka struct Node}’ from type ‘void *’ hasht->node[i]=NULL; "
I don't understand why hasht->node[i] is a Node, not a Node*.
How can I get a Node* member in the Table variable with a Table*?