The remove function for my singly linked chain does not work when I remove the very first node. Say I have {33,40,50} when I try and remove 33 i get a segfault, but the other two work fine. I think I just need some fresh eyes to see what i messed up in my remove function.
remove function
bool Set::remove(int X)
{
bool Flag = false;
Node * Prev = Head;
Node * Curr = Head->Succ;
//unsigned Z = 0;
while(Curr->Item != X)
{
Prev = Curr;
Curr = Curr->Succ;
}
Prev->Succ =Curr->Succ;
delete Curr;
Num--;
Flag = true;
return Flag;
}