24小时热门版块排行榜    

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

zxj1991

铜虫 (小有名气)

win7写C语言一般都有错
我就是我
7楼2012-06-30 14:55:20
已阅   回复此楼   关注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的回帖
最具人气热帖推荐 [查看全部] 作者 回/看 最后发表
[考研] 296求调剂 +3 www_q 2026-03-20 3/150 2026-03-21 16:47 by barlinike
[考研] 286分人工智能专业请求调剂愿意跨考! +4 lemonzzn 2026-03-17 7/350 2026-03-21 16:09 by lemonzzn
[考研] 265求调剂 +12 梁梁校校 2026-03-19 14/700 2026-03-21 13:38 by lature00
[考研] 299求调剂 +4 shxchem 2026-03-20 6/300 2026-03-21 11:54 by 无际的草原
[考研] 一志愿华中科技大学,080502,354分求调剂 +5 守候夕阳CF 2026-03-18 5/250 2026-03-21 01:06 by JourneyLucky
[考研] 296求调剂 +6 www_q 2026-03-18 10/500 2026-03-20 23:56 by JourneyLucky
[考研] 一志愿南昌大学,327分,材料与化工085600 +9 Ncdx123456 2026-03-19 9/450 2026-03-20 23:41 by lovewei0727
[考研] 294求调剂材料与化工专硕 +15 陌の森林 2026-03-18 15/750 2026-03-20 23:28 by JourneyLucky
[考研] 求调剂,一志愿:南京航空航天大学大学 ,080500材料科学与工程学硕,总分289分 +4 @taotao 2026-03-19 4/200 2026-03-20 22:14 by JourneyLucky
[考研] 药学383 求调剂 +3 药学chy 2026-03-15 5/250 2026-03-20 22:11 by 云游重阳
[考研] 281求调剂(0805) +14 烟汐忆海 2026-03-16 25/1250 2026-03-20 15:47 by yuncha
[考博] 招收博士1-2人 +3 QGZDSYS 2026-03-18 3/150 2026-03-20 11:58 by 呱呱呱呱叫
[考研] 0703化学调剂 +4 18889395102 2026-03-18 4/200 2026-03-19 16:13 by 30660438
[考研] 085601专硕,总分342求调剂,地区不限 +5 share_joy 2026-03-16 5/250 2026-03-18 14:48 by haxia
[考研] 考研求调剂 +3 橘颂. 2026-03-17 4/200 2026-03-17 21:43 by 有只狸奴
[考研] 材料工程专硕274一志愿211求调剂 +6 薛云鹏 2026-03-15 6/300 2026-03-17 11:05 by 学员h26Tkc
[考研] 一志愿南京大学,080500材料科学与工程,调剂 +4 Jy? 2026-03-16 4/200 2026-03-17 11:02 by gaoqiong
[考研] 机械专硕325,寻找调剂院校 +3 y9999 2026-03-15 5/250 2026-03-16 19:58 by y9999
[考研] 326求调剂 +3 mlpqaz03 2026-03-15 3/150 2026-03-16 07:33 by Iveryant
[考研] 本科南京大学一志愿川大药学327 +3 麦田耕者 2026-03-14 3/150 2026-03-14 20:04 by 外星文明
信息提示
请填处理意见