+ 1
Why it's output is 0 1🥲??
2 Respostas
+ 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...
+ 1
Thank you it works 🙂