Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- #ifndef STACKADT_H
- #define STACKADT_H
- #include <Stack.h>
- #include <iostream>
- using namespace std;
- template <typename E>
- class StackADT {
- private:
- void operator =(const StackADT&) {}
- StackADT(const StackADT&) {}
- E P[100];
- int top = 0;
- public:
- StackADT() {}
- ~StackADT() {}
- void clear(){
- top = 0;
- }
- void push(const E& it){
- P[top] = it;
- top++;
- }
- E pop(){
- E top = P[this->top - 1];
- this->top--;
- cout << "Pop de: " << top << endl;
- }
- const E& topValue(){
- return P[top - 1];
- }
- int length(){
- return top;
- }
- };
- #endif // STACKADT_H
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement