Advertisement
Loesome

Main Stack

Apr 6th, 2014
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.49 KB | None | 0 0
  1. #include "StackADT.h"
  2. #include <iostream>
  3. using namespace std;
  4.  
  5. int main()
  6. {
  7. StackADT<int> stack/* = new StackADT<int>()*/;
  8.  
  9.  
  10. stack.push(2);
  11. stack.push(3);
  12. stack.push(4);
  13. stack.push(1);
  14. stack.push(10);
  15. cout << "Top: " << stack.topValue() << endl;
  16. cout << "Size: " << stack.length() << endl;
  17. stack.pop();
  18. stack.push(120);
  19. stack.push(10992);
  20. cout << "Top: " << stack.topValue() << endl;
  21. cout << "Size: " << stack.length() << endl;
  22. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement