student类中少了一个缺省构造函数student(){}加上就行了template Stack::Stack( )//初始化栈 { MAXSIZE=50; stack= new ElemType[MAXSIZE];// stack=(ElemType *)malloc(MAXSIZE*sizeof(ElemType)); top=-1; } 初始化的时候需要调用~