Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- /**
- * [LinkedStack.h]
- * The LinkedStack class declaration/specification.
- */
- #ifndef LINKEDSTACK_H
- #define LINKEDSTACK_H
- #include <iostream>
- struct Node
- {
- float element;
- Node *next;
- };
- class LinkedStack
- {
- /**
- * Everything under public can be accessed by all other programs or classes.
- */
- public:
- /**
- * Constructor(s):
- */
- LinkedStack();
- /**
- * Constructor(s):
- */
- ~LinkedStack();
- /**
- * Mutators:
- */
- void Push(float);
- /**
- * Accessors:
- */
- void Pop(float &);
- /**
- * General Use:
- */
- void MakeEmpty(void); // empties the stack
- bool IsEmpty(void); // returns true if the stack is empty
- bool IsFull(); // returns true if the stack is full
- /**
- * Everything under protected can be accessed only by the class itself or (derived) subclasses,
- * as in the case of inheritance.
- */
- protected:
- /**
- * (Private) DATA MEMBERS/PROPERTIES:
- *
- * Everything under private can only be accessed by the class itself (the code in the
- * implementation file).
- */
- private:
- Node *top; // a node pointing to the top of the stack
- };
- #endif // LINKEDSTACK_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement