/* Lecture Code 5.0 * * Basic use of the STL stack type. */ #include #include using namespace std; const int NUM_INTS = 10; int main() { stack myStack; for(int i = 0; i < NUM_INTS; i++) myStack.push(i); cout << "The size is " << myStack.size() << endl; cout << "The top element is " << myStack.top() << endl; while(!myStack.empty()) { cout << myStack.top() << ' '; myStack.pop(); } cout << endl; return 0; }