class TmplStack {
	AVAR     *stkarray;
	int    stksiz, top;

 public:

	TmplStack(int stacksize) {
		if (stacksize <= 0) stacksize = 1;
		stkarray = new AVAR[stacksize];
		stksiz = stacksize;
		top = 0;
	}

	~TmplStack() {
		delete[] stkarray;
	}

	bool isEmpty() {
		return top == 0 ? true : false;
	}

	bool isFull() {
		return top == stksiz ? true : false;
	}

	void push(const AVAR& elmt) {
		if (isFull()) {
			return;
		}
		stkarray[top++] = elmt;
	}

	AVAR pop() {
		if (isEmpty()) {
			return;
		} else {
			--top;
		}
		return stkarray[top];
	}
};
