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

error c2146_error c2059_error c2018(2)

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

{

if(isEmpty())

return ERROR;

else

e=*--top;

return OK;

}

template <typename ElemType>

void SqStack<ElemType>::push(ElemType& e)

{

int length=top-base;

ElemType *newbase;

if(top-base>=stackSize)

{

newbase=new ElemType[stackSize+STACKINCREMENT];

assert(newbase!=0);

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

*(newbase+j)=*(base+j);

delete []base;

stackSize+=STACKINCREMENT;

base=newbase;

top=base+length;

}

*top=e;

++top;

}

template <typename ElemType>

SqStack<ElemType>::SqStack()

{

base=new ElemType[STACK_MAX_SIZE];

assert(base!=0);

stackSize=STACK_MAX_SIZE;

top=base;

}

template <typename ElemType>

SqStack<ElemType>::~SqStack()

{

if(base)

delete []base;

stackSize=0;

top=base=NULL;

}

template <typename ElemType>

SqStack<ElemType>::SqStack(const SqStack& otherS)

{

int length;

base=new ElemType[otherS.stackSize];

assert(base!=0);

stackSize=otherS.stackSize;

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

*(base+i)=*(otherS.base+i);

top=base+length;

}

总是出现这样的错误

ompiling...

q.cpp

f:\microsoft visual studio\myprojects\zhan\q.cpp(10) : error C2146: syntax error : missing ';' before identifier 'getTop'

f:\microsoft visual studio\myprojects\zhan\q.cpp(23) : see reference to class template instantiation 'SqStack<ElemType>' being compiled

f:\microsoft visual studio\myprojects\zhan\q.cpp(10) : error C2501: 'Status' : missing storage-class or type specifiers

f:\microsoft visual studio\myprojects\zhan\q.cpp(23) : see reference to class template instantiation 'SqStack<ElemType>' being compiled

f:\microsoft visual studio\myprojects\zhan\q.cpp(13) : error C2146: syntax error : missing ';' before identifier 'pop'

f:\microsoft visual studio\myprojects\zhan\q.cpp(23) : see reference to class template instantiation 'SqStack<ElemType>' being compiled


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

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

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