不可抗力txt百度云盘:C++正常编译 VC++编译出错了 怎么回事

来源:百度文库 编辑:查人人中国名人网 时间:2024/05/07 07:21:09
#include <iostream.h>
int add(int x,int y)
{
int z;
z=x+y;
return z;
}
void main(void)
{
int a,b,sum;
cout<<"input a,b:";
cin>>a>>b;
sum=add(a,b);
cout<<"sum="<<sum<<endl;
}

编译出错:
--------------------Configuration: TC - Win32 Debug--------------------
Compiling...
TC.cpp
f:\vc++6.0\tc\tc.cpp(16) : fatal error C1010: unexpected end of file while looking for precompiled header directive
ccc.cpp
F:\VC++6.0\TC\ccc.cpp(12) : error C2653: 'ccc' : is not a class or namespace name
F:\VC++6.0\TC\ccc.cpp(15) : warning C4508: 'ccc' : function should return a value; 'void' return type assumed
F:\VC++6.0\TC\ccc.cpp(17) : error C2653: 'ccc' : is not a class or namespace name
F:\VC++6.0\TC\ccc.cpp(18) : error C2084: function 'int __cdecl ccc(void)' already has a body
Generating Code...
Error executing cl.exe.

TC.exe - 4 error(s), 1 warning(s)

我在我机子上试啦,没错,运行正常 没错误,是不是你在VC 上多打了什么字母啦!!!

ccc是个什么东西..