Here is my code that deletes the no of list items from last.I trying to implement the linked list concept.
void del(list** head,int da,int n) { //da-for no of elements to be
list *l1; //deleted from end.
int n1 = n-da; //n-for total no of elements in list
if (n1 == 0)
*head = NULL;
else {
l1 = *head;
n1 = n1-1;
while(n1) {
l1 = l1->next;
n1--;
}
l1->next=NULL;
}
}
after including this code I am getting SIGSEGV error. What does it mean? Kindly help me with this code. As I have started learning data structures recently.I dont have that much programming experience but I know some basics in C.