b2科目四模拟试题多少题驾考考爆了怎么补救
b2科目四模拟试题多少题 驾考考爆了怎么补救

error c2146_error c2059_error c2018

电脑杂谈  发布时间:2017-06-12 18:00:33  来源:网络整理

error c2146_error c2018_error c2059

error c2146error c2146

为什么会出现error C2146:

#include<stdio.h>

#include<stdlib.h>

template <typename ElemType>

class SqStack

{

public:

void clear();

int getLength();

int getstackSize();

Status getTop(ElemType& e);

bool isEmpty();

SqStack<ElemType>operator=(SqStack<ElemType>rightS);

Status pop(ElemType& e);

void push (ElemType& e);

SqStack();

virtual ~SqStack();

SqStack(const SqStack<ElemType>& otherS);

protected:

ElemType *base;

ElemType *top;

intstackSize;

};

template <typename ElemType>

void SqStack<ElemType>::clear()

{

base=top;

}

template <typename ElemType>

int SqStack<ElemType>::getLength()

{

return top-base;

}

template <typename ElemType>

int SqStack<ElemType>::getstackSize()

{

return SqStackSize;

}

template <typename ElemType>

Status SqStack<ElemType>::getTop(ElemType& e)

{

if(isEmpty())

return ERROR;

else

e=*(top-1);

error c2146_error c2018_error c2059

return OK;

}

template <typename ElemType>

bool SqStack<ElemType>::isEmpty()

{

return (top==base true:false);

}

template <typename ElemType>

SqStack<ElemType>SqStack<ElemType>::operator =(SqStack rightS)

{

int length=rights.getLength();

if(this!=&rightS)

{

if(stackSize<rightS.stackSize)

{

delect[] base;

base=new ElemType[right.stackSize];

assert(base!=0);

stackSize=rightS.stackSize;

}

for(int i=0;i<length;i++)

*(base+1)=*(rightS.base+i)

top=base+length();

}

return *this;

}

template <typename ElemType>

Status SqStack<ElemType>::pop(ElemType& e)


本文来自电脑杂谈,转载请注明本文网址:
http://www.pc-fly.com/a/dianqi/article-52420-1.html

相关阅读
    发表评论  请自觉遵守互联网相关的政策法规,严禁发布、暴力、反动的言论

    热点图片
    拼命载入中...