So I’m trying to make a prefix tree, but I’m not sure if this would cause some logical error of some sort?
typedef struct TreeTag
{
char letter;
struct TreeTag *links[26]; /* Is this advisable? */
int fullword;
int linknum;
}TreeNode;
Yes, array of pointers to struct node is allowed
If you do this:
so there is no problem to declare array of pointers.
When you need the more than one pointers to the same struct you do this
so why can’t you do this
Similarly
struct node *p[26]is also possible but everything depends on your requirement and implementation.One requirement , As I think think of
d-ary tree(where each node has d nodes)And you want to directly nevigate to it’s children from parent node.
so
struct node *child[d]is legal (where d is#defined)