Hello,
I'm sorry if this has been asked before, but I didn't seem to find any answers. I'm trying to write a function that would delete a specified number from a singly linked list.
This is what i've got so far, but it's not working:
void remove(list*& start, int s)
{
list* pom=NULL;
list* pom2=NULL;
while(pom!=NULL)
{
pom=start;
if(pom->next->value==s)
{
pom2=pom->next;
pom->next=pom->next->next;
delete pom2;
}
start=start->next;
}
}