If I cut "head=temp" line from ins function definition and paste it after ins function call, this program works smoothly but why it is not working good in this above condition? please explain!!Code:#include<stdio.h> #include<stdlib.h> struct node{ int data; struct node *next; }; void ins(struct node *temp,struct node *head) { temp->next=head; head=temp; #error caused by this line } void main() { struct node *head,*temp,*p; char c; int i; printf("Do you want to enter data? Y/N "); scanf("%c",&c); fflush(stdin); if(c=='y'||c=='Y') { head=(struct node *)malloc(sizeof(struct node)); printf("enter your data: "); scanf("%d",&i); fflush(stdin); head->data=I; head->next=NULL; printf("Do you want to enter more data? Y/N "); scanf("%c",&c); fflush(stdin); } while(c=='y'||c=='Y') { temp=(struct node *)malloc(sizeof(struct node)); printf("enter your data: "); scanf("%d",&i); fflush(stdin); temp->data=i; temp->next=NULL; ins(temp,head); printf("Do you want to enter more data? Y/N "); scanf("%c",&c); fflush(stdin); } p=head; while(p!=NULL) { printf("%d ",p->data); p=p->next; } }