Oct 17, 2005 #1 R rose_mary Banned Joined Oct 17, 2005 Messages 0 Helped 0 Reputation 0 Reaction score 0 Trophy points 1,280 Activity points 0 hi room, I can't seem to define a linked list successfully. I tried typedef struct { char *item; NODEPTR next; } *NODEPTR; but the compiler gave me error messages. Can't a structure in C contain a pointer to itself? pls someone answer me soon.
hi room, I can't seem to define a linked list successfully. I tried typedef struct { char *item; NODEPTR next; } *NODEPTR; but the compiler gave me error messages. Can't a structure in C contain a pointer to itself? pls someone answer me soon.
Oct 17, 2005 #2 artem Advanced Member level 4 Joined May 22, 2003 Messages 1,347 Helped 126 Reputation 252 Reaction score 32 Trophy points 1,328 Location Turkey Activity points 13,451 C question? rewrite like this typedef struct tnode{ char *item; struct tnode *next; } *NODEPTR;
Oct 18, 2005 #3 E echo47 Advanced Member level 6 Joined Apr 7, 2002 Messages 3,933 Helped 638 Reputation 1,274 Reaction score 90 Trophy points 1,328 Location USA Activity points 33,176 C question? By the way, that's question 1.14 of the comp.lang.c FAQ: https://www.eskimo.com/~scs/C-faq/q1.14.html
C question? By the way, that's question 1.14 of the comp.lang.c FAQ: https://www.eskimo.com/~scs/C-faq/q1.14.html