StackOps.cc


#include <iostream>                          // for cout
#include <string>
#include <stack>                 
#include <vector>
using namespace std;

int main()
{
    stack< string, vector<string> > s;      

    s.push( "me" );
    s.push( "to" );
    s.push( "talk" );

    while ( !s.empty() ) {
        cout << s.top() << " ";              // talk to me
        s.pop();
    }

    return 0;
}


Results

C:\classes\ece538\work\kak05>StackOps
talk to me


Maintained by John Loomis, updated Sun Jan 07 14:20:26 2007