// Phil Ottewell's STL Course - http://www.pottsoft.com/home/stl/stl.htmlx // // Example 4.1 © Phil Ottewell 1997 // // Purpose: // Demonstrate use of stack container adaptor // ANSI C Headers #include // C++ STL Headers #include #include #include #ifdef _WIN32 using namespace std; #endif int main( int argc, char *argv[] ) { stack< const char *, vector > s; // Push on stack in reverse order s.push("order"); s.push("correct"); // Oh no it isn't ! s.push("the"); s.push("in"); s.push("is"); s.push("This"); // Pop off stack which reverses the push() order while ( !s.empty() ) { cout << s.top() << " "; s.pop(); /// Oh yes it is ! } cout << endl; return( EXIT_SUCCESS ); }