出现这样的错误:cpp(50) : error C2143:c0031 syntax errorr : missing ';' before 'constant' 怎么改呢

这个错误怎么改?error C2143: syntax error : missing ';' be…_c++吧_百度贴吧
&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&签到排名:今日本吧第个签到,本吧因你更精彩,明天继续来努力!
本吧签到人数:0成为超级会员,使用一键签到本月漏签0次!成为超级会员,赠送8张补签卡连续签到:天&&累计签到:天超级会员单次开通12个月以上,赠送连续签到卡3张
关注:166,422贴子:
这个错误怎么改?error C2143: syntax error : missing ';' be…收藏
不是提示的很清楚了吗?缺少分号啊!
#include&iostream.h&#include&stdlib.h&class seqlist{protected:datetype *public:seqlist(int max=0);~seqlist(void);int size(void)void insert(const datetype &int i);datetypq Delete(const int i);datetypq getdate(int i)};seqlist::seqlist(int max);{maxsize=size=0;list=new datetypq[maxsize];}seqlist::~seqlist(void){ delete []}int seqlist::size(void)const{}void seqlist::insert(const datetypq& item,int i){if(size==maxsize){cout&&"顺序表已满无法插入!"&&exit(0);}if(i&0||i&size){cout&&"参数i越界!";exit(0);}for(int j=j&i;j--){list[j]=list[j-1];list[i]=size++;}}datetypq seqlist::Delete(const int i){if(size==0){cout&&"顺序表以空无法删除!";exit(0);}if(i&0||i&size-1){cout&&"参数i越界错误!";exit(0);}for(int j=i;j&size-1;j++){size--;}}datetypq seqlist::getdate(int i)const{if(i&0||i&size-1){cout&&"参数i越界错误!";exit(0);}return list[i];}int main(){seqlist mylist(100);int n=10; for(int i=0;i&n;i++) mylist.insert (i+1,i); mylist.Delete(4); for(i=0;i&mylist.size();i++) cout&&mylist.getdate(i)&&" ";}--------------------Configuration: Linlist - Win32 Debug--------------------Compiling...Linlist.cppC:\Documents and Settings\Administrator\桌面\Linlist.cpp(6) : error C2143: syntax error : missing ';' before '*'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(6) : error C2501: 'datetype' : missing storage-class or type specifiersC:\Documents and Settings\Administrator\桌面\Linlist.cpp(6) : error C2501: 'list' : missing storage-class or type specifiersC:\Documents and Settings\Administrator\桌面\Linlist.cpp(12) : error C2040: 'size' : 'int (void) const' differs in levels of indirection from 'int'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(13) : error C2143: syntax error : missing ',' before '&'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(13) : error C2059: syntax error : '&'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(13) : error C2143: syntax error : missing ')' before ';'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(13) : error C2059: syntax error : ')'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(14) : error C2146: syntax error : missing ';' before identifier 'Delete'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(14) : error C2501: 'datetypq' : missing storage-class or type specifiersC:\Documents and Settings\Administrator\桌面\Linlist.cpp(15) : error C2146: syntax error : missing ';' before identifier 'getdate'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(15) : error C2501: 'datetypq' : missing storage-class or type specifiersC:\Documents and Settings\Administrator\桌面\Linlist.cpp(18) : error C2447: missing function header (old-style formal list?)C:\Documents and Settings\Administrator\桌面\Linlist.cpp(26) : error C2065: 'list' : undeclared identifierC:\Documents and Settings\Administrator\桌面\Linlist.cpp(26) : error C2541: delete : cannot delete objects that are not pointersC:\Documents and Settings\Administrator\桌面\Linlist.cpp(30) : error C2063: 'size' : not a functionC:\Documents and Settings\Administrator\桌面\Linlist.cpp(30) : error C2040: 'size' : 'int (void) const' differs in levels of indirection from 'int'C:\Documents and Settings\Administrator\桌面\Linlist.cpp(30) : fatal error C1903: unable to recover from previous error(s); stopping compilation执行 cl.exe 时出错.Linlist.obj - 1 error(s), 0 warning(s)
datatype是个你自己定义的数据类型,必需声明,是否是个class,或者是否漏了typedef?之后的datatypq是否打错?如果不是拼写错误,也要声明。
登录百度帐号推荐应用
为兴趣而生,贴吧更懂你。或C++有一个错误改不过来&br/&syntax error : missing &)& before &;&
C++有一个错误改不过来syntax error : missing &)& before &;& 5
#include&iostream&#include&string&#define N 20class C{public:&C(char *s)& {cout&&"构"&&ch=new char[N];strcpy(ch,s);}&~C() {cout&&"析"&&}private:&char *};void main()(char s[N];&cin&&s;&C P(s);}C:\Users\LXF\Desktop\4.cpp(14) : error C2143: syntax error : missing ')' before ';'C:\Users\LXF\Desktop\4.cpp(14) : error C2091: function returns functionC:\Users\LXF\Desktop\4.cpp(15) : error C2143: syntax error : missing ';' before '&&'C:\Users\LXF\Desktop\4.cpp(15) : error C2501: 'cin' : missing storage-class or type specifiersC:\Users\LXF\Desktop\4.cpp(15) : error C2143: syntax error : missing ';' before '&&'C:\Users\LXF\Desktop\4.cpp(16) : error C2065: 's' : undeclared identifierC:\Users\LXF\Desktop\4.cpp(17) : error C2143: syntax error : missing ';' before '}'C:\Users\LXF\Desktop\4.cpp(17) : error C2143: syntax error : missing ';' before '}'C:\Users\LXF\Desktop\4.cpp(17) : error C2143: syntax error : missing ';' before '}'
qwer1234构析Press any key to continue
#include &iostream&#include &string&#define N 20class C {public:&C(char *s) { cout&&"构"&& ch = new char[N]; strcpy(ch,s); }&~C() { cout&&"析"&& }private:&char *};
void main() { //&这儿是{,不是(&char s[N];&cin&&s;&C P(s);}
#include&iostream&#include&string&#define N 20class C{public:&C(char *s)& {cout&&"构"&&ch=new char[N];strcpy(ch,s);}&~C() {cout&&"析"&&}private:&char *};void main(){char s[N];//这里是{不该是(cin&&s;C P(s);}
其他回答 (3)
(char s[N];
这里少了一个括弧
(char s[N];
这里应该是大括号
{char s[N];
void main()(char s[N];&cin&&s;&C P(s);}你看看你上面那段代码main函数的大括号左半边 怎么变成了小括号呢?
相关知识等待您来回答
编程领域专家
& &SOGOU - 京ICP证050897号C语言常见错误_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
评价文档:
C语言常见错误
C​语​言​常​见​错​误​,​英​语​与​中​文​对​照​表
阅读已结束,如果下载本文需要使用
想免费下载本文?
把文档贴到Blog、BBS或个人站等:
普通尺寸(450*500pix)
较大尺寸(630*500pix)
你可能喜欢C++问题:cpp(3) : error C2143: syntax error : missing ';' before 'PCH creation point'_百度知道
C++问题:cpp(3) : error C2143: syntax error : missing ';' before 'PCH creation point'
%d&%d&quot,xshcj[i];
printf(&; int xuehao.h&quot.grade[0]););n&#92.grade[4]);n 数学;80,&xshcj[i];
printf(&quot,&xuehao);;请输入学号; scanf(&quot.grade[2]);&#92,&xshcj[i];n操作;
scanf(&,xshcj[i];
scanf(&quot.grade[3]);%d&
return.name);
scanf(&n\
if(xshcj[i]:&quot:&n\ for(i,xshcj[i];英语;
printf(&姓名;%d&%d&
printf(&quot:&;查找完毕或没有有效数据;.grade[0]);;n&quot:&n\%s&quot:&;;n英语;&#92.grade[3]);extern cjgl xshcj[80].grade[1]);;%d&
scanf(&quot,&xshcj[i];
printf(&quot:%d&quot,xshcj[i];
printf(&n工具;n\),xshcj[i];),xshcj[i]:%d&);;),&xshcj[i]:&quot!&#92: &quot:%d&quot.grade[1]);;i&学号;
scanf(&;n&;
printf(&;i++) {
if(xshcj[i];\\
printf(&quot.xh==-1)
printf(&(错误提示指向了这一行;%d&);工具;操作;););.grade[4]):&编程;\);n编程.xh);;数学;
printf(&quot:%d&quot,&xshcj[i],xshcj[i];);\ printf(&);%d&quot#include&quot: &quot,还有其他几个文件也是这指向了类似这个位置)void gxcjf(){ int i=0;
printf(&;cj_.xh==xuehao)
printf(&n更新&#92.grade[2]);
printf(&quot
提问者采纳
cjgl是什么东西 如果是个类出现这种错误最有可能是你在定义cjgl类的末尾未加;
提问者评价
嗯,是的,谢谢啦
其他类似问题
为您推荐:
其他3条回答
extern cjgl xshcj[80];这里cjgl跟xshcj之间空格系统会报错
也许是那个头文件里写错了什么东西
是不是定义cjgl结构时{}后面没有分号
cpp的相关知识
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 syntax error 的文章

 

随机推荐