I've defined the struct as following:
// Node struct
typedef struct node
{
// Node value
char word[LENGTH + 1];
// Node Pointer to next value/node
struct node* next;
}
node;
// Hash table of node pointers
node* hashtable[LENGTH];
This issue is when i'm using
while(fscanf(file, "%s\n", word)!= EOF)
in my load function I get the error "use of undeclared identifier 'word'; did you mean 'load'?"
Does this mean I have to initialise an array before I declare the fscaf function such as
char word[LENGTH + 1];
I just thought this would result in creating a totally different array not related to the original struct.
Have a bit of trouble understanding calling word in this situation
I thought I could just add something such as node.word in the fscanf function instead.
while(fscanf(file, "%s\n", node.word)!= EOF)
Not sure what the pros and cons of each would as i'm assuming later on if I wanted to use the word function i.d have to declare it via "node.word"