I am currently learning linked list and our proff gave us this code but I can't seem to compile it, what's the problem here?
I can't seem to print the value of x :| why is it like that?Code:#include<stdio.h> #include<stdlib.h> #include<string.h> struct node { int x; struct node *next; }; int main() { struct node *root; struct node *conductor; conductor=root; root = malloc(sizeof(struct node)); root->next=0; root->x=5; while(conductor->next!=0); { printf("%d",conductor->x); conductor=conductor->next; } system("pause"); }
(EDIT Done with the tagging )