#include "mydefs2a.h" // Linked list implementation of stacks. int_stack :: node* int_stack :: new_node(int d, node* n) { cout << "Adding " << d << " to stack" << endl; node* t = new node; assert( t ); t -> data = d; t -> next = n; return( t ); } int int_stack :: pop() { assert( !isempty() ); int t = top -> data; node* oldtop = top; top = top -> next; delete oldtop; return t; }