I've read an answer to a similar question about
node* new_node = malloc(sizeof(node));
and how it allocates memory for the pointer plus all the data contained within the struct as it was declared
typedef struct node
{
char word[LENGTH +1]
struct node* next;
}
node;
But when I create an array for my hash-table, I just want the indices to contain only pointers, and not to allocate memory for the structs that these pointers point to.
Does node* hashtable[500];
create an array of pointers or does it create an array of node
s ?
If the latter is true, how do I create the hash-table so that the indices of the array contain pointers that do not have memory allocated for them. Is the following code useful?
typedef node *link
node;
link *hashtable[500];