EDIT: @kate87 - Hehe CIACH...! Może nie zdążył zobaczyć :P
Aaaa dobra, niech będzie:
#include<iostream>
using namespace std;
template <class T>
class stack {
private:
int size;
int count;
T* root;
public:
stack(int size) : size(size), count(0), root(new T[size]) {}
~stack() { delete[] this->root; }
bool push(const T& value) {
if (this->count < this->size) {
return true;
}
return false;
}
T pop() {
}
void print() {
}
};
int main() {
return 0;
}
Jak są drobne błędy to sorry ale trochę nie chce mi się myśleć n-ty raz nad stosem w C++. Niech sobie popatrzy co jest nie tak jakby co... ;) Jakoś tam działa. Jakieś tam operatory poprzekierowywać może sobie jeszcze... takie tam.