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