Program to use your stack class
#include <iostream.h>
#include “stack.h”
main()
{
stack a, b;
a.push(5);
a.push(10);
a.pop();
a.push(30);
a.push(40);
while (a.size())
b.push(a.pop());
while (b.size())
cout << b.pop() << endl;
}
// This should output: 5 30 40
Previous slide
Back to first slide
View graphic version