-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathStackt.h
More file actions
36 lines (27 loc) · 850 Bytes
/
Stackt.h
File metadata and controls
36 lines (27 loc) · 850 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
// File: Stackt.h
// Stack template class definition.
// Dynamic array implementation
#ifndef STACKT_H
#define STACKT_H
template <class Type>
class Stackt
{
public:
Stackt(int nelements = 128); // Constructor
Stackt (const Stackt<Type> &); // Copy Constructor
~Stackt(); // Destructor
// Member Functions
void push(Type ); // Push
void pop(Type &); // Pop
void stackTop(Type &) const; // retrieve top
bool stackIsEmpty() const; // Test for Empty stack
bool stackIsFull() const; // Test for Full stack
//int gettop() const;
int getsize() const;
private:
Type *stack; // pointer to dynamic array
int top, MaxSize;
int size;
};
#endif // STACKT_H
#include "Stackt.cpp"