I'm trying to figure out where/how to define the root node of my trie in dictionary.c. I have declared my struct node as follows:
typedef struct node
{
bool is_word;
struct node* children[27];
}
node;
To my understanding, I need a (pointer to) the root node that can be used by both load and check, so I can't define it in load or check. However, when I try to do
node* root = malloc(sizeof(node));
outsude of either function, the compiler throws me "initializer element is not a compile-time constant".
How do I fix this?