数据结构关于顺序表的进栈的有关问题

数据结构关于顺序表的进栈的问题
我在做数据结构的练习,把顺序栈的类定义和实现都写了,测试的时候发现进栈出了问题,也就是 stack.push(x); 这句

编译器报错如下:
c:\documents and settings\longkai\my documents\visual studio 2010\projects\stack\stack\seqstack.h(45): 编译类 模板 成员函数“void SeqStack<T>::overflowProcess(void)”时
  with
  [
  T=int
  ]
  c:\documents and settings\longkai\my documents\visual studio 2010\projects\stack\stack\seqstack.h(39): 编译类 模板 成员函数“SeqStack<T>::SeqStack(int)”时
  with
  [
  T=int
  ]
  c:\documents and settings\longkai\my documents\visual studio 2010\projects\stack\stack\main.cpp(9): 参见对正在编译的类 模板 实例化“SeqStack<T>”的引用
  with
  [
  T=int
  ]

一下是具体的程序,请大家帮帮忙!

#include <assert.h>
#include <iostream>

const int stackIncreament = 20;

template <class T>
class SeqStack {
private:
T* elements;
int top;
int maxSize;
void overflowProcess();

public:
SeqStack(int sz = 50);

~SeqStack() { delete[] elements; }

void push(T& x);

bool pop(T& x);

bool getTop(T& x);

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

bool isFull() { return top == maxSize - 1 ? true : false; }

int getSize() { return top + 1; }

void makeEmpty() { top = -1; }

//friend ostream& operator << (ostream& os, SeqStack<T>& s) {
};

template <class T>
SeqStack<T>::SeqStack(int sz) : top(-1), maxSize(sz) {
elements = new T[maxSize];
assert(elements != NULL);
}

template <class T>
void SeqStack<T>::overflowProcess() {
T* newArray = new T[maxSize + stackIncreament];
if (newAway == NULL) {
cerr << "存储分配失败!" << endl;
exit(1);
}
for (int i = 0; i <= top; i++) {
newArray[i] = elements[i];
}
delete[] elements;
elements = newArray;
}

template <class T>
void SeqStack<T>::push(T& x) {
/*if (isFull()) {
overflowProcess();
}
elements[++i] = x; // also test i++*/
isFull() ? overflowProcess() : elements[++top] = x;
}

template <class T>
bool SeqStack<T>::pop(T& x) {
if (isEmpty()) {
return false;
}
x = *elements[top--]; // compare --top
return true;
}

template <class T>
bool SeqStack<T>::getTop(T& x) {
if (isEmpty()) {
return false;
}
x = elements[top];
return true;
}

#include <iostream>
#include "SeqStack.h"
using namespace std;


int main() {

int x = 1;
SeqStack<int> stack;
cout << stack.getSize() << endl;
cout<< stack.isFull() << endl;
stack.push(x);
cout << x <<endl;
}

------解决方案--------------------
template <class T>
void SeqStack<T>::overflowProcess() {
T* newArray = new T[maxSize + stackIncreament];
if (newAway == NULL) { // 一个简单的拼写错误,跟模板无关,呵呵
cerr << "存储分配失败!" << endl;
exit(1);
}
for (int i = 0; i <= top; i++) {
newArray[i] = elements[i];
}
delete[] elements;
elements = newArray;
}