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?
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");
}
I can't seem to print the value of x :| why is it like that?
(EDIT Done with the tagging )