Given the code:
(yes, I'm aware that in this configuration, the node will be pointing to itself).Code:typedef struct { int item; struct node *next; } node; int main(int argc, char *argv[]) { node *n = malloc(sizeof(node)); n->item = 5; n->next = n; return 0; }
Why does gcc (OSX 10.5) report the following error:
josephus.c: In function 'main':
josephus.c:15: warning: assignment from incompatible pointer type
Thanks!