[C++] Stack 구현(클래스)


[C++] Stack 구현(클래스)

#include <iostream> #include <string> using namespace std; template<typename T> class Stack_template { private: T* arr; int capacity; int top; public: Stack_template(); Stack_template(int size); ~Stack_template(); bool isEmpty(); bool isFull(); T peek(); void push(T num); T pop(); }; template<typename T> Stack_template<T>::Stack_template() :capacity(3) { arr = new T[capacity]; top = -1; } template<typename T> Stack_template<T>::Stack_template(int size) :capacity(size) { arr = new T[capacity]; to...



원문링크 : [C++] Stack 구현(클래스)