Reputation: 434
My struct looks like this:
struct Node
{
int value;
struct Node *children[26];
};
typedef struct Node *List;
I would like to assign first (main) struct to variable (or pointer) so I could come back to it (after moving to 'substructs'). i.e
start = malloc(sizeof(struct Node));
(this variable) = start;
list = (this variable);
list = list -> children[25];
...
list = (this variable) //We're again in main/first struct.
Upvotes: 0
Views: 58
Reputation: 2122
so…. why can't you say:
List start = malloc(whatever);
List list = start;
list = list->children[25]; // index 26 is out of bounds…
Is the problem that you're not sure you can declare something of type List?
Upvotes: 1