c++sql语法错误误,望指正。

vs2010c++语法错误。我用vs6.0c++可以编译,用vs2010就不行,求解答。
[问题点数:0分]
vs2010c++语法错误。我用vs6.0c++可以编译,用vs2010就不行,求解答。
[问题点数:0分]
不显示删除回复
显示所有回复
显示星级回复
显示得分回复
只显示楼主
本帖子已过去太久远了,不再提供回复功能。跪求指正语法错误There are many details we should pay more attention in our life.For example,you should check faucet and pipe line of water pipe,see whether leak.Then you need make sure to repair dripping faucets by replacing washers.Though th_百度作业帮
跪求指正语法错误There are many details we should pay more attention in our life.For example,you should check faucet and pipe line of water pipe,see whether leak.Then you need make sure to repair dripping faucets by replacing washers.Though th
跪求指正语法错误There are many details we should pay more attention in our life.For example,you should check faucet and pipe line of water pipe,see whether leak.Then you need make sure to repair dripping faucets by replacing washers.Though that can be thought a piece of cake,even is leak a small drop water ,a month will flow a great amount water.It is not just a kind of waste,and you have to pay for the waste.Take agriculture into account,agricultural restructuring will continue.We should use less water of agriculture.Take strict measures to adjust agricultural structure and develop ecological agriculture.The main problem of water shortage lies in tradition patterns of agriculture.We should first develop water-saving agriculture.Then increase in the utilization of water and expand the effective irrigation area of farmland.The same problem also exist in industry.The third way is to take strict measures to adjust agricultural and industrial structure and develop ecological agriculture and industry.Take agriculture into account,agricultural restructuring will continue.We should use less water of agriculture.The main problem of water shortage lies in tradition patterns of agriculture.We should first develop water-saving agriculture.Then increase in the utilization of water and expand the effective irrigation area of farmland.The same problem also exist in industry.We can take measures to circulate water for industry over and over in factovies and treated sewage water is for irrigation in farming land.That can not only solve the problem of sewage water but also save water.Then pay more attention and concern to conserve water resource.Make good use of science and technology to promote water saving.In developing and utilizing water resources and in controlling water disaaters,planning should be performed in a comprehensive and systematic manner with all aspects taken into account and with empaases on multiple purpose uses and achieving maximum benefits so as to allow full play to the multiple function of wter resources.
There are many details we should pay more attention in our life.pay attention是不及物的,后面必须要加toFor example,you should check faucet and pipe line of water pipe,see whether leak.这里一个句子有两个谓语动词,应该在see前面加and或者to,加and表示“你应该检查水龙头,管道和看看下水道是不是泄漏”;加to则表示“你应该检查水龙头,管道以便知道下水道是不是泄漏”.whether leak的表达应该是错的,whether做连词,引导一个从句.改为 whether it is leakThen you “need to make sure ”to repair even it leaks a small drop of water it will flow a great amount water in a month.是不是翻译器翻译的.C++语法错误_百度文库
两大类热门资源免费畅读
续费一年阅读会员,立省24元!
C++语法错误
这​是​C​+​+​常​见​的​语​法​错​误​ ​对​C​+​+​的​学​习​很​有​帮​助
阅读已结束,如果下载本文需要使用
想免费下载本文?
下载文档到电脑,查找使用更方便
还剩1页未读,继续阅读
你可能喜欢1474人阅读
CSDN大牛较多,本人小白,若交流,本人欢迎,若言语偏颇,请绕行。
这二天,工作比较空闲,就看了一些基础的C++语法知识,收获颇多,下面只讲switch& case语句的一些语法细节。请大家坚持看完,第五大点是重点,经测试连C++ Primer都给出了错误的讲解。若为大牛,请直接拖到文章最后看最后一大点。
一、case标号内是否可以使用continue代替break?
&&& 答案是否定的。continue只用于循环语句中,作用是中止本次循环;break语句才能中断switch& case控制流(return、goto等且不算作正常的中断)。
二、default只可以写在所有case标号之后吗?
&&& 答案也是否定的。default可以写在任何位置且作用不变,只是看起来很别扭而已,你可以理解default是一个特别的case,并不代表着一个switch的结束。
&&& 这是新手经常会误解的知识点,总觉得default之后,switch就结束了,这是一种固定思维带来的错误推断。
三、下面的代码是正确的吗?
&&& switch(ch)
&&&& case:
&&&& default:
&&& 答案是不正确。一个标号不能独立不能独立存在,它必须位于语句之前。如果是空语句,你写成如下形式。
&&& switch(ch)
&&&& case:
&&&&&&&& ;
&&&& default:
&&&&&&&& {}&&&& // ;,{}可以互换
四、下面的代码是正确的吗?若正确,执行结果是什么?若不正确,为什么?
&&&&&&& char ch = 'f';
&&&&&&& switch(ch)
&&&&&&&&&&&&&&& default:
&&&&&&&&&&&&&&&&&&&&&&& cout && &I'm default.& &&
&&&&&&&&&&&&&&&&&&&&&&& ch = 'b';
&&&&&&&&&&&&&&& case 'a':case 'b':case 'c': case 'd':
&&&&&&&&&&&&&&& {&&&&&&
&&&&&&&&&&&&&&&&&&&&&&& cout && ch &&
&&&&&&&&&&&&&&&&&&&&&&&
&&&&&&&&&&&&&&& }
&&&&&&&&&&&&&&& cout && &Do I run?& &&
&&&& 代码是正确的。运行结果是:
&I'm default.
五、这一题是我想要说的重点,因为连C++ Primer中文版(第四版)这本书也讲解错误。详情见C++ Primer中文版(第四版)176页6.6.5小节的第一句。(原文为:“对于switch结构,只能在它的最后一个case标号或者default标号后面定义变量:……”)
&&& 下面的这几段代码是正确的吗?如果不正确为什么?
&&& 5.1 char ch = 'f';
&&&&&&& switch(ch)
&&&&&& default:
&&&&&&&&&&&&&& &
&&&&&& case 'f':
&& &&&&&&&&&&&&
&&&&&& case 'a':
&&&&&&&&&&&&&& int temp = 0;
&代码是正确的,g++编译通过。
&&& 5.2 char ch = 'f';
&&&&&&& switch(ch)
&&&&&&& case 'f':
&&&&&&&&&&&&&&
&&&&&&& case 'a':
&&&&&&&&&&&&&&&
&&&&&&& default:
&&&&&&&&&&&&&& int temp = 0;
&&&&&&&&&&&&&&
&代码是正确的,g++编译通过。
&&& 5.3 char ch = 'f';
&&&&&&& switch(ch)
&&&&&&& default:&&
&&&&&&&&&&&&&&& &
&&&&&&& case 'b':
&&&&&&&&&&&&&&&&&
&&&&&&& case 'f':
&&&&&&&&&&&&&&&&&int temp = 0;
&&&&&&&&&&&&&&& &
&&&&&&&&case 'a':
&&&&&&&&&&&&&&&&&
&代码是错误的,g++编译未通过。
&通过上面的三个例子,“对于switch结构,只能在它的最后一个case标号或者default标号后面定义变量”这句话似乎是正确的。请看下一例。
&&& 5.4 char ch = 'f';
&&&&&&& switch(ch)
&&&&&& default:
&&&&&&&&&&&&&&& int temp = 0;
&&&&&&&&&&&&&&&
&&&&&& case 'f':
&&&&&&&&&&&&&&&
&&&&&& case 'a':
&&&&&&&&&&&&&&
&代码是错误的,g++编译未通过。所以说C++ Primer的前半句是正确的,而后半句是错误的。应该改成“对于switch结构,只能在它的最后一个标号(switch和case)后面定义变量”。
&解释这个问题,请见第二点,default本质上与case并无不同,你可以把他看成范围较大的case。
&现在再解释一下,为什么只能在switch结构的最后一个标号后面定义变量?
&答:拿5.3的代码为例,大家都知道temp的生命周期为开始定义的位置至这个块语句的结束(也就是到‘}‘这个位置)。要知道switch& case语句为块语句,也就是temp变量会在块结束之前一直存在,那么case 'b'中当然可以使用这个变量。但是如果说ch = 'b',这时程序会直接跳到case 'b'而不会跳到temp变量的声明定义处的case 'f'中,此处若使用变量temp,那么temp就是未定义就使用了。为了避免这种情况的发生,所以C++规定“对于switch结构,只能在它的最后一个标号后面定义变量”,这样就有效避免了变量未定义就使用的问题的发生。
C++博大精深,望勿浮躁,共勉。
版权声明:本文为博主原创文章,未经博主允许不得转载。
* 以上用户言论只代表其个人观点,不代表CSDN网站的观点或立场
访问:40289次
排名:千里之外
原创:31篇
评论:26条
(1)(3)(1)(1)(5)(1)(1)(1)(1)(3)(3)(5)(3)(2)c++错误,望指正!_百度知道
c++错误,望指正!
-----------------------------&;-----------------------------\qipan[i][0]=&#39:; to 'FIVE\┼&#39,j; for(i=1;
&iostream&j&lt: Five();qipan[0][14]='14;&}void F;const int'& qipan[i][14]='qipan[14][0]='F
&MSDev98\j++)
qipan[i][j]='}报错提示;i&; }}int main(){ F;┴&#39: ';qipan[14][14]='&i&='
&lt:Five(){ qipan[0][0]=' return 0;&quot: cannot convert from 'MyProjects&#92: 14;14;i++) {
for(j=0; : error C2440;&class Five{}:\FIVE.CPP(…) ;&qipan[14][i]=&#39#include &lt:zpm(){ cout&15:;├'} for(i=1;
There are no converc++\┘'┌' char qipan[15][15];Program Files\j& void zpm();i&
cout&lt.zpm();n&&i++) {qipan[0][i]='n&i++)
for(j=i;;┬'char [4]';; for(i=0;qipan[i][j];15;j++)
cout&;┤'┐'&lt:D;
\&└&#39
提问者采纳
return&Five();j&&qipan[i][0]=&┌&&&qipan[14][0]=&&&┼&&&&&14;&&&i;for(i=1;├&i&lt:zpm(){&15;&&&zpm();F&┐&&&string&&&&nbsp,而这种'&&nbsp:Five(){&&&for(i=1;&for(i=0;&nbsp,修改后代码如下;qipan[0][0]=&┘&i&&&&&using&&&main(){&qipan[i][14]=&&-----------------------------&{qipan[0][i]=&&&&&0;&;&&┬&qipan[i][j]=&};for(j=0;&&qipan[14][i]=&j++)&&&&&cout&&i++)&i++)&┤&&int&&namespace&&&&&Five{&qipan[i][j];&&&nbsp:#include&;cout&&&{&&&qipan[0][14]=&&&14;&&&class&&j++)&&&&&&&private:&&&&;&&&&&&&&&&&&&&for(j=i;cout&&nbsp.zpm();&&&}}int&&&&i&&-----------------------------\n&}&&&&&&nbsp:;五子棋&;&&;qipan[14][14]=&14;&&┼'&符号确有4个字节;&&i++)&void&&&nbsp,j;&nbsp:&&&&j&&lt:;&&C++中char才一个字节;&&└&&#include&&&qipan[15][15];&&&&&&15;Five&&;&iostream&&&nbsp,所以不可能放的下;&&;string&;&&&┴&&&&F}void&&&&&\n&&&&nbsp,建议改为string
提问者评价
来自团队:
其他类似问题
为您推荐:
等待您来回答
下载知道APP
随时随地咨询
出门在外也不愁

我要回帖

更多关于 sql语法错误 的文章

 

随机推荐