设为首页
收藏本站
开启辅助访问
切换到窄版
登录
立即注册
中问网首页
我的收藏
站长博客
搜索
搜索
本版
帖子
用户
第一问答网
»
论坛
›
中问网
›
问答
›
请看我这段C代码,有什么错误
返回列表
发新帖
请看我这段C代码,有什么错误
[复制链接]
11
|
2
|
2009-7-10 18:12:08
|
显示全部楼层
|
阅读模式
我在VC++6.0新建了一个 Win32 Applicatio,然后添加了一个C++文件,就输入了下边这段代码,代码我在CODEBLOCKS和DEVC++里编译都能通过,但是在VC++6.0里边就不行,说有一个错误,0个警告。究竟错在哪了呢?
#include
int main(void)
{
long numHe=0;//总和初始为0
long numDan;//一个变量
int status;
printf("Please enter a integer");
status=scanf("%ld",&numDan);
while(status==1)
{
numHe=numDan+numHe;
printf("Please enter next:");
status=scanf("%ld",&numDan);
}
printf("Thank you for Playing\n");
printf("All zhe integers: %ld",numHe);
return 0;
}
下边是出错信息
--------------------Configuration: forc1 - Win32 Debug--------------------
Compiling...
forc1-1-1.c
Linking...
LIBCD.lib(wincrt0.obj) : error LNK2001: unresolved external symbol _WinMain@16
Debug/forc1.exe : fatal error LNK1120: 1 unresolved externals
执行 link.exe 时出错.
Creating browse info file...
forc1.exe - 1 error(s), 0 warning(s)
回复
使用道具
举报
千问
|
2009-7-10 18:12:08
|
显示全部楼层
%Id?...
回复
使用道具
举报
千问
|
2009-7-10 18:12:08
|
显示全部楼层
status=scanf("%ld",&numDan);用scanf("%ld",&numDan);status=numDan;试试...
回复
使用道具
举报
返回列表
发新帖
高级模式
B
Color
Image
Link
Quote
Code
Smilies
您需要登录后才可以回帖
登录
|
立即注册
本版积分规则
发表回复
回帖后跳转到最后一页
千问
主题
0
回帖
4882万
积分
论坛元老
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
论坛元老, 积分 48824836, 距离下一级还需 -38824837 积分
积分
48824836
加好友
发消息
回复楼主
返回列表
问答
热门排行