大家帮帮忙,看看这个程序。
#include<iostream>
int main()
{
int x=5;
int y=7;
std::cout<<end1;
std::cout<<x+y<<""<<x*y;
std::cout<<end;
return 0;
}
运行结果:
Compiling...
1.cpp
E:\my project\hello world\1\1.cpp(8) : error C2065: 'end1' : undeclared identifier
E:\my project\hello world\1\1.cpp(10) : error C2065: 'end' : undeclared identifier
我是照着一本书上打的,结果出现这样的错误,看半天不知道为什么。
照着有的网页上说的加上
#include<string>
using namespace std;
还是出现一样的错误。
谢谢了!
谢谢大家的回答!我已经改过来了,可是还是出现了错误。
我用的是VC++6.0英文版的,我怀疑是我的编译器有问题,可是别的程序我也都能运行,欢迎大家解答。
#include<iostream>
int main()
{
int x=5;
int y=7;
std::cout<<endl;//这个就是end line,不是一
std::cout<<x+y<<""<<x*y;
std::cout<<endl; //这个就是end line,不是一
return 0;
}
这样的话还是有一个错误。
Compiling...
1.cpp
D:\my project\1\1\1.cpp(7) : error C2065: 'endl' : undeclared identifier