// Test driver for generic Stack class #include using namespace std; #include #include "Stack.h" int main() { Stack s1; for (int i = 0; i < 10; ++i) s1.push(3 + 2*i); s1.dump(cout); while (!s1.empty()) cout << s1.pop() << " "; cout << endl; s1.dump(cout); Stack s2; for (int i = 0; i < 15; ++i) s2.push(i); s1 = s2; for (int i = 0; i < 7; ++i) s2.pop(); s1.dump(cout); s2.dump(cout); static const char * s[] = { "Tom", "Dick", "Harry", "Moe", "Curly" }; Stack t1; for (int i = 0; i < sizeof(s)/sizeof(const char *); ++i) t1.push(s[i]); while (!t1.empty()) cout << t1.pop() << " "; cout << endl; return 0; }