News:

MyKidsDiary.in :: Capture your kids magical moment and create your Online Private Diary for your kids

Main Menu

Stack of string and vector: push(), pop(), empty(), top()

Started by aruljothi, Jun 11, 2009, 07:21 PM

Previous topic - Next topic

aruljothi

#include <iostream>
#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() << " ";
          s.pop();
     }
     return 0;
}