Created
October 7, 2014 20:38
-
-
Save tyleryasaka/fa6d8325df901787bec6 to your computer and use it in GitHub Desktop.
stack.h
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef _STACK_H | |
#define _STACK_H | |
#include <iostream> | |
using namespace std; | |
template <class T> | |
class Stack{ | |
T* data; | |
int top; | |
int max_size; | |
public: | |
Stack(); | |
Stack(int size); | |
Stack(const Stack<T>& s); | |
Stack& operator=(const Stack<T>& s); | |
~Stack(); | |
bool IsEmpty()const; | |
bool IsFull()const; | |
bool Push(T item); | |
bool Pop(T &item); | |
template <class U> | |
friend ostream& operator<<(ostream& os, const Stack<U>& s); | |
}; | |
#endif |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment