#include<iostream.h>
void main()
{
int i(1),sum(0);
while(i<=10)
{
sum+=i
i++;
}
cout<<"sum="<<sum<<end1;
}刚入门,请别见笑
这是我在书上看到的,今天装了Tc++3.0,调试的时候提示
║ Compiling ..\TEST\NONAME00.CPP:
║&#8226;Error ..\TEST\NONAME00.CPP 4: Parameter names are used
║ Error ..\TEST\NONAME00.CPP 5: Declaration missing ;
║ Error ..\TEST\NONAME00.CPP 9: Undefined symbol 'sum'
║ Error ..\TEST\NONAME00.CPP 9: Undefined symbol 'end1'
书上说是在vc++6.0上调试通的,又装了vc++6.0
提示如下
--------------------Configuration: Cpp2 - Win32 Debug--------------------
Compiling...
Cpp2.cpp
D:\test\Cpp2.cpp(8) : error C2146: syntax error : missing ';' before identifier 'i'
D:\test\Cpp2.cpp(10) : error C2065: 'end1' : undeclared identifier
Error executing cl.exe.Cpp2.exe - 2 error(s), 0 warning(s)为什么啊?这是书上的代码啊
我看的是郑莉和董渊主编的《c++语言程序设计》,是学生教程
请教了