24小时热门版块排行榜    

查看: 1648  |  回复: 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的回帖

易沁桦

木虫 (小有名气)

引用回帖:
8楼: Originally posted by newetimesky at 2012-07-05 20:37:36
请问楼主这个问题解决了吗?
error C2143: syntax error : missing ';' before ')'
这个问题,你是怎么解决的?

和3楼说的一样,< =中间有空格···········去掉了,就没有莫名其妙的语法错误了
努力工作,开心生活
9楼2012-07-06 20:30:16
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
查看全部 9 个回答

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的回帖

smart0193

木虫 (小有名气)

【答案】应助回帖


感谢参与,应助指数 +1
jjdg: 金币+1, 感谢参与 2012-06-21 01:06:33
把代码贴上来才能知道啊。
一个奋斗在三流高校的教育界民工
3楼2012-06-20 23:02:25
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖

文俊点点

木虫 (著名写手)

【答案】应助回帖

★ ★ ★ ★ ★ ★
感谢参与,应助指数 +1
jjdg: 金币+1, 感谢参与 2012-06-21 01:06:39
易沁桦: 金币+5, 有帮助, 3 2012-06-21 08:42:59
你的< =中间有空格···········
这是你所拥有的时间·····这是你所能改变的生活·········
4楼2012-06-20 23:57:00
已阅   回复此楼   关注TA 给TA发消息 送TA红花 TA的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 化学调剂 +3 yzysaa 2026-03-21 3/150 2026-03-21 16:40 by macy2011
[考研] 材料 271求调剂 +4 展信悦_ 2026-03-21 4/200 2026-03-21 16:32 by barlinike
[考研] 一志愿西安交通大学材料工程专业 282分求调剂 +8 枫桥ZL 2026-03-18 10/500 2026-03-21 15:29 by Shawn0911
[考研] 材料与化工(0856)304求 B区 调剂 +3 邱gl 2026-03-21 3/150 2026-03-21 13:47 by lature00
[考研] 南昌大学材料专硕311分求调剂 +6 77chaselx 2026-03-20 6/300 2026-03-21 07:24 by JourneyLucky
[考研] 二本跨考郑大材料306英一数二 +3 z1z2z3879 2026-03-17 3/150 2026-03-21 02:29 by JourneyLucky
[考研] 一志愿重庆大学085700资源与环境专硕,总分308求调剂 +3 墨墨漠 2026-03-18 3/150 2026-03-21 00:39 by JourneyLucky
[考研] 288求调剂 +16 于海海海海 2026-03-19 16/800 2026-03-20 22:28 by JourneyLucky
[考研] 材料学硕297已过四六级求调剂推荐 +11 adaie 2026-03-19 11/550 2026-03-20 21:30 by laoshidan
[考研] 一志愿武理材料工程348求调剂 +3  ̄^ ̄゜汗 2026-03-19 4/200 2026-03-20 21:01 by zhukairuo
[论文投稿] 申请回稿延期一个月,编辑同意了。但系统上的时间没变,给编辑又写邮件了,没回复 10+3 wangf9518 2026-03-17 4/200 2026-03-19 23:55 by babero
[考研] 生物学调剂招人!!! +3 山海天岚 2026-03-17 4/200 2026-03-19 21:34 by 怎么释怀
[考研] 085600材料与化工调剂 324分 +10 llllkkkhh 2026-03-18 12/600 2026-03-19 14:33 by llllkkkhh
[考研] 材料专硕306英一数二 +10 z1z2z3879 2026-03-16 13/650 2026-03-18 14:20 by 007_lilei
[考研] 301求调剂 +4 A_JiXing 2026-03-16 4/200 2026-03-17 17:32 by ruiyingmiao
[考研] 一志愿苏州大学材料工程(085601)专硕有科研经历三项国奖两个实用型专利一项省级立项 +6 大火山小火山 2026-03-16 8/400 2026-03-17 15:05 by 无懈可击111
[考研] 275求调剂 +4 太阳花天天开心 2026-03-16 4/200 2026-03-17 10:53 by 功夫疯狂
[考研] 302求调剂 +4 小贾同学123 2026-03-15 8/400 2026-03-17 10:33 by 小贾同学123
[考研] 327求调剂 +6 拾光任染 2026-03-15 11/550 2026-03-15 22:47 by 拾光任染
[考研] 0856专硕279求调剂 +5 加油加油!? 2026-03-15 5/250 2026-03-15 11:58 by 2020015
信息提示
请填处理意见