Hi This prg is for creating a link list .But Iam not able to understand what will last line do q->link=tmp; Code: int create(int data) { struct node *q,*tmp; tmp=malloc(sizeof(struct node)); tmp->info=data; tmp->link=NULL; if(start==NULL) start=tmp; else { q=start; while(q->link!=NULL) { q=q->link; } [B]q->link=tmp;[/B] // why this is required } }
in temp you are taking the data to be inserted in the linked list . so you are attaching that node as the next node of q here