I can't understand why this part of code doesn't build and run... I have checked it again and again but I can;t find the problem.The problem is at Insert void 2nd line.
struct Node {
int data;
struct Node* next;
};
struct Node* head;
void Insert(int x){
struct Node* temp = (Node*)malloc(sizeof(struct Node));
(*temp).data = x;
(*temp).next = NULL;
}
void Print(){
struct Node* temp = head;
printf("List is :\n");
while (temp != NULL){
printf("%d",temp->data);
temp = temp->next;
}
printf("\n");
}
int main() {
head = NULL;
printf("How many numbers ?\n";)
int n,i,x;
scanf("%d", &n);
for (i=0;i<=n;i++){
printf("Enter the number \n");
scanf("%d",&x);
Insert(x);
Print();
}
return 0;
}