OK. This is what I have (headers intentionally excluded). Same compile error.
Code:
typedef struct nodeT node;
typedef struct {
int value;
node *next;
} nodeT;
int
main(int argc, char* argv[]) {
nodeT *node = malloc(sizeof(nodeT));
nodeT *next = malloc(sizeof(nodeT));
node->value = 5;
node->next = next;
return 0;
}
Maybe I'm not understanding this correctly. What's the difference between declaring a struct in the following manners:
Code:
typedef struct {
...
} nodeT;
Code:
typedef struct Node {
...
} nodeT;
and
Code:
struct Node {
...
}