[Solved] class destructor segmentation fault
Your pop function destroys the entire stack. It deletes the tmp node (by calling the Stack destructor), which still points to the new next. And since the Stack destructor calls delete on next, you get a mess of multiple destructor calls on the same objects. JMA beat me to it by a few seconds, so … Read more