Why it's output is 0 1🥲?? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
1st Sep 2022, 12:01 PM
Shweta Yadav
2 Answers
+ 1
free(head) deletes next link. Try this way : void del_first(struct node*head){ if(head==NULL){ printf("list is already empty"); } else { struct node* n = head; n->data = n->link->data; n->link = n->link->link; head = n; n = NULL; } } Hope it helps...
1st Sep 2022, 1:02 PM
Jayakrishna 🇮🇳
+ 1
Thank you it works 🙂
1st Sep 2022, 4:02 PM
Shweta Yadav