//stack_test.cpp //EE 312 //tests a very simple cursor based Stack ADT #include #include "stack_312_LL.h" using namespace std; template void showStack(const Stack_312 & myStack); int main () { cout << "hello" << endl; Stack_312 myStack; Stack_312 stack2; stack2.push("ehy"); stack2.push("hello"); showStack(stack2); myStack.push(42); myStack.push(52); myStack.push(12); cout << "test pushes" << endl; showStack(myStack); Stack_312 myStack2 = myStack; //copy constructor myStack.pop(); myStack.pop(); cout << "test pops" << endl; showStack(myStack); cout << "show other Stack, test copy constructor" << endl; showStack(myStack2); } //prints Stack. //note that the cursor is at the EOL when finished template void showStack(const Stack_312 & myStack) { Stack_312 temp = myStack; cout << endl; cout << "stack from top " << endl; while (!temp.isEmpty()) { cout << temp.pop() << endl; } }