C语言初学者求助! 在VC++6.0中编译最简单的C语言程序都过不了,请高手帮忙。

[复制链接]
查看11 | 回复4 | 2011-9-28 08:52:36 | 显示全部楼层 |阅读模式
很简单的原因,printf("this is a c program.\n");包含头的英文写错了是includevoid 改为int ,在语句的最后添加return 0;就可以了。如:(复制粘贴就可以搞掂了)#include intmain(){ printf("this is a c program.\n");return 0;}...
回复

使用道具 举报

千问 | 2011-9-28 08:52:36 | 显示全部楼层
#includ 少了个e应该是#include printf("this is a c program.\n"少);应该是printf("this is a program.\n");在C++中规定main主函数的返回值必须是int型不能为void,所以要在后面加上return 1;下面是我的代码:#include /*注意include拼写*/int main(void) /*这事标准写法,但是 void main()也是可以运行的*/{printf(" this is a c program.\n");/*分号结束*/} 估计是你软件原因了...
回复

使用道具 举报

千问 | 2011-9-28 08:52:36 | 显示全部楼层
#includ改为#include,你少些了字母eprintf("this is a c program.\n" 这句需要后面加上);#include void main(){ printf("this is a c program.\n");}...
回复

使用道具 举报

千问 | 2011-9-28 08:52:36 | 显示全部楼层
应该是#include
,另外c的语句结束是以分号结束的,现在一般将main指定为int型,返回值 0...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行