//We are going to define the stack here.
#ifndef _stack_rules_
#define _stack_rules_
template <class ItemType>
class stack
{
public: //shouldn't really have anything private since we don't care about the size and whatever of the stack
bool isEmpty() const = 0; //check to see if the stack is empty
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
bool pop() = 0; //pop off the top thing from the stack (LIFO)
virtual ItemType peek() = 0; //look at what's the top of the stack
};
#endif
Comments