For speller.c, you can't pass a pointer to the root node (I'm using a trie) to check()
, size()
, and unload()
.
And I couldn't create a global root node in dictionary.c
error: initializer element is not a compile-time constant
So, how do they know what to check, measure and unload?
getNode()
I created, which returns a pointer to an empty node. So, in dictionary.c, I initializedstruct node* root = getNode();
outside the functions, so it will be accessible to all functions.struct node* = NULL;
struct node*
is a data type! How can I initialize a data type to NULL?struct node* root = NULL
!