home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / cset21v1.zip / IBMCPP / SAMPLES / COMPILER / SAMPLE07 / METHOD2 / MAIN.CPP < prev    next >
Encoding:
C/C++ Source or Header  |  1993-05-17  |  755 b   |  27 lines

  1. #include <iostream.h>
  2. #include "stk.h"
  3. #include <assert.h>
  4. #include <stdio.h>
  5.  
  6. void 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.    }
  27.