Why am I getting a segemetation fault
May 27, 2017 at 5:29am UTC
This is a function of Menu class.
The odd thing is even if I comment ou this line it causes Seg fault. Basically if I do anything even if I do this->option_list[this->count - 1]
1 2 3 4 5 6 7 8 9 10 11 12 13 14
void Menu::pop_back() {
cout << "INPOP_BACK\n" ;
cout << this ->count<<"\n" ;
cout << this ->isEmpty()<<"\n" ;
if (this ->isEmpty()){
cout << "There is nothing to remove" ;
}else {
cout<< "inside POP_BACK \n" ;
cout << this ->option_list[this ->count - 1] << "\n" ;
this ->option_list[this ->count - 1].set(NULL); //Segmentation fault here
this ->count = this ->count - 1;
}
}
May 27, 2017 at 5:33am UTC
Please don't start a new topic about the same subject, just keep the original topic going. Have you tried the advice given in the previous answers?
Topic archived. No new replies allowed.