home *** CD-ROM | disk | FTP | other *** search
/ Power GUI Programming with VisualAge C++ / powergui.iso / trialva / ibmcppw / samples / compiler / sample07 / method2 / main.cpp next >
Encoding:
C/C++ Source or Header  |  1996-02-20  |  771 b   |  29 lines

  1. #include <iostream.h>
  2. #include "stk.h"
  3. #include <assert.h>
  4. #include <stdio.h>
  5.  
  6. int main(void)
  7.    {
  8.    stack<int> s(10);
  9.    stack<int> ss(10);
  10.    stack<int> s2(10);
  11.    stack<int> s3(10);
  12.    cout << "\n\nCalling functions in the DLL\n\n";
  13.    cout << "Number of stacks is " <<  stack<int>::numberOfStack << '\n';
  14.    cout << "Pushing the following sequence of numbers on the stack: 2 4 1 3" << '\n';
  15.    s.push(2);
  16.    s.push(4);
  17.    s.push(1);
  18.    s.push(3);
  19.    cout << "Poping the numbers from the stack: sequence expected 3 1 4 2\n";
  20.    cout << "Sequence from Pop operations: ";
  21.    cout << s.pop() << ' ' ;
  22.    cout << s.pop() << ' ' ;
  23.    cout << s.pop() << ' ' ;
  24.    cout << s.pop() << '\n';
  25.    cout << "Program terminates \n";
  26.    return 0;
  27.    }
  28. 
  29.