24小时热门版块排行榜    

查看: 1543  |  回复: 8
当前只显示满足指定条件的回帖,点击这里查看本话题的所有回帖

易沁桦

木虫 (小有名气)

[求助] VC++下调试C程序,出现很多语法错误

用纯的C语言编了个程序(不会C++),在VC++中打开后,点击Build—Compile后,出现以下:(surface growth.c前面的E:\VC Project\Crystal Growth\都省略了)
-----Configuration: surface growth - Win32 Debug--------------------
Compiling...
surface growth.c
surface growth.c(17) : error C2059: syntax error : '='
surface growth.c(17) : error C2143: syntax error : missing ';' before ')'
surface growth.c(19) : warning C4552: '<=' : operator has no effect; expected operator with side-effect
surface growth.c(19) : error C2143: syntax error : missing ';' before ')'
surface growth.c(23) : error C2059: syntax error : 'for'
surface growth.c(23) : error C2143: syntax error : missing '{' before '<='
surface growth.c(23) : error C2059: syntax error : '<='
surface growth.c(23) : error C2143: syntax error : missing '{' before '++'
surface growth.c(23) : error C2059: syntax error : '++'
surface growth.c(23) : error C2059: syntax error : ')'
surface growth.c(24) : error C2143: syntax error : missing '{' before '<='
surface growth.c(24) : error C2059: syntax error : '<='
surface growth.c(24) : error C2143: syntax error : missing '{' before '++'
surface growth.c(24) : error C2059: syntax error : '++'
surface growth.c(24) : error C2059: syntax error : ')'
surface growth.c(26) : error C2059: syntax error : 'for'
surface growth.c(26) : error C2143: syntax error : missing '{' before '<='
surface growth.c(26) : error C2059: syntax error : '<='
surface growth.c(26) : error C2143: syntax error : missing '{' before '++'
surface growth.c(26) : error C2059: syntax error : '++'
surface growth.c(26) : error C2059: syntax error : ')'
surface growth.c(27) : error C2143: syntax error : missing '{' before '<='
surface growth.c(27) : error C2059: syntax error : '<='
surface growth.c(27) : error C2143: syntax error : missing '{' before '++'
surface growth.c(27) : error C2059: syntax error : '++'
surface growth.c(27) : error C2059: syntax error : ')'
surface growth.c(36) : error C2059: syntax error : 'for'
surface growth.c(36) : error C2143: syntax error : missing '{' before '<='
surface growth.c(36) : error C2059: syntax error : '<='
surface growth.c(36) : error C2143: syntax error : missing '{' before '++'
surface growth.c(36) : error C2059: syntax error : '++'
surface growth.c(36) : error C2059: syntax error : ')'
surface growth.c(45) : error C2059: syntax error : 'for'
surface growth.c(45) : error C2143: syntax error : missing '{' before '<'
surface growth.c(45) : error C2059: syntax error : '<'
surface growth.c(45) : error C2059: syntax error : ')'
surface growth.c(46) : error C2449: found '{' at file scope (missing function header?)
surface growth.c(149) : error C2059: syntax error : '}'
surface growth.c(151) : error C2143: syntax error : missing ')' before 'string'
surface growth.c(151) : error C2143: syntax error : missing '{' before 'string'
surface growth.c(151) : error C2059: syntax error : ''
surface growth.c(151) : error C2059: syntax error : ')'
surface growth.c(152) : error C2059: syntax error : 'for'
surface growth.c(152) : error C2143: syntax error : missing '{' before '<='
surface growth.c(152) : error C2059: syntax error : '<='
surface growth.c(152) : error C2143: syntax error : missing '{' before '++'
surface growth.c(152) : error C2059: syntax error : '++'
surface growth.c(152) : error C2059: syntax error : ')'
surface growth.c(158) : error C2059: syntax error : '}'
执行 cl.exe 时出错.
surface growth.obj - 1 error(s), 0 warning(s)
——————————————————————
     可是我觉得语法没有错,比如最开始两句,对应第17行的句子是:  for (x = 1; x < =N; x++),“=”号怎么有错呢,)前面也不用加“;”了啊
   而且最后一句显示只有一个错误,到底是哪儿呢?
求大侠解答。若解决了问题,还可以追加金币,谢谢!!
回复此楼

» 猜你喜欢

» 本主题相关价值贴推荐,对您同样有帮助:

努力工作,开心生活
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

libralibra

至尊木虫 (著名写手)

骠骑将军

【答案】应助回帖


感谢参与,应助指数 +1
jjdg: 金币+1, 感谢参与 2012-06-21 01:06:27
一般这种错误要先考虑是不是头文件引用问题
有时候头文件的引用顺序不对劲都会给你来一堆莫名其妙的语法错误
matlab/VB/python/c++/Java写程序请发QQ邮件:790404545@qq.com
2楼2012-06-20 22:48:45
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
相关版块跳转 我要订阅楼主 易沁桦 的主题更新
信息提示
请填处理意见