this is probably very simple, but how can I get structure x in structure x in C? For example:
typedef struct _Node { Node node; } Node;
I did some research and tried using pointers, for example:
typedef struct _Node { struct Node *node; } Node;
Although this leaves the node variable as a pointer that I don't want, I just want it to be an instance of the node structure. Thanks for any help. :)
EDIT:
Essentially, I'm trying to do the following:
Node current = createNode(...); while (true) { Node node = createNode(..., ¤t); addToList(node); current = somethingElse(); }
As you can imagine, I want a regular node to go into the createNode () function:
Node createNode(..., Node node) {}
source share