// Test program for stacks. // To compile: // CC TestStack.cpp Exception.cpp -o TestStack #include "Stack.h" #include const int N = 100000; int main( ) { Stack S; for( int i = 0; i < N; i++ ) S.Push( i ); for( int j = N - 1; !S.IsEmpty( ); S.Pop( ) ) if( S.Top( ) != j-- ) cout << "Stack operation failed!" << endl; return 0; }