Silver_Smoulder

StackRules.h (mine)

Apr 10th, 2019
227
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.58 KB | None | 0 0
  1. //We are going to define the stack here.
  2. #ifndef _stack_rules_
  3. #define _stack_rules_
  4. template <class ItemType>
  5. class stack
  6. {
  7. public: //shouldn't really have anything private since we don't care about the size and whatever of the stack
  8.  
  9. bool isEmpty() const = 0; //check to see if the stack is empty
  10.  
  11. bool push(const ItemType& newEntry) = 0; //push a new thing on the stack in the format of a constant with a pointer and the item
  12.  
  13. bool pop() = 0; //pop off the top thing from the stack (LIFO)
  14.  
  15. virtual ItemType peek() = 0; //look at what's the top of the stack
  16.  
  17. };
  18.  
  19. #endif
Advertisement
Add Comment
Please, Sign In to add comment