the_fornicator
TRIBE Member
okay, maybe I'm stupid and I can't see past a glaring error but for the life of me, it's killing me. It's been a while since I played with C but I'm trying to implement a simply single linked list.
I have a struct:
struct node{
struct node *next_node;
char *name;
};
In my main, when I attempt to malloc some space for the fucker:
struct node *current = (struct node *)malloc(sizeof(struct node));
I get an error saying: "sizeof applied to an incomplete type."
wtf? the struct looks pretty simple to me. Nothing major.
any ideas???
thanks in advance Wilson
I have a struct:
struct node{
struct node *next_node;
char *name;
};
In my main, when I attempt to malloc some space for the fucker:
struct node *current = (struct node *)malloc(sizeof(struct node));
I get an error saying: "sizeof applied to an incomplete type."
wtf? the struct looks pretty simple to me. Nothing major.
any ideas???
thanks in advance Wilson