#include "stack.h" stack::stack() { topptr = NULL; } void stack::push(string x) { node * tmp = new node; tmp->data = x; tmp->next = topptr; topptr = tmp; } string stack::pop() { if( empty() ) { return "HEY! STack is EMPTY IDIOT!"; } else { node * tmpptr; string tmpstr; tmpptr = topptr; topptr = topptr->next; tmpstr = tmpptr->data; delete tmpptr; return tmpstr; } } bool stack::empty() { return (topptr == NULL); }