I have a simple doubly linked list for a class I am in and I keep getting a seg fault on my last line of code, no matter what i make it. I can put a bunch of random couts and it will print them all then on the last one seg fault, all my test functions are working how they should too. Any idea what would cause a seg fault? only things in the class are what my prof says are the typical functions... The big 3, popBack/front, pushback/front and a few others that already work as they should... Only thing i can think of is the destructor causing a seg fault. the destructor just calls my popback function which the code for is below...could this be the problem? any help is appreciated.
void Dll11List::popBack(){
Dll11Node* nodeptr;
if(isEmpty()){
cerr<<"\nList is Empty";
return;
}
if(_first->_fore == NULL){
delete _last;
_first = NULL;
_last = NULL;
}else{
nodeptr = _last->_back;
delete _last;
_last = nodeptr;
}
--_size;
}