//tstack.cpp //test driver for class Stack implemented using array #include #include #include "stack.h" main () { Stack s; assert(s.isempty()); // Push the sequence 0 .. TOS-1 onto the stack for (int i = 0; i < TOS; i++) { s.push(i); assert(!s.isempty()); } assert(!s.isempty()); // Pop the stack; verifying the sequence TOS-1 .. 0 for (i = TOS-1; i >= 0; i--) assert(i == s.pop()); // The stack should now be empty assert(s.isempty()); return 0; }