I want to do something like this.
typedef struct Test{
int value;
struct Test* parent;
struct Test** children;
}Test;
So I want a node that points to another parent structure. Then I want a dynamically allocated array that points to child nodes. My question is that I have no idea how this would work syntactically.
For example,
Test* first;
Test* second;
Test* third;
(*third).value = 1;
(*first).parent = second;
(*first).child[0] = third;
printf("%d\n",(*first).(*child[0]).value);
doesn't compile. I'm assuming I need to do something with malloc to allocate space for the array of pointers but I'm not sure. Also I'm not sure how I would access the "value" of the parent and child directories.