错误1错误C2065:"endl":未声明的标识符 [英] Error 1 error C2065: 'endl' : undeclared identifier
问题描述
大家好,
刚刚正在处理我需要编译的代码,但是它给出了错误消息"endl":未声明的标识符
这是我的代码
#include< iostream>
int main()
{
std :: cout<< 你好.\ n";
std :: cout<< 这里是5:"<< 5<<"\ n";
std :: cout<< 操纵器endl在屏幕上写了新行.";
std :: cout<<
endl;
std :: cout<<<这是一个很大的数字:\ t"<< 70000<< endl;
std :: cout<<<这里是8和5的总和:\ t"<< 8 + 5<< endl;
std :: cout<<<这里是一个小数:\ t \ t"<< (浮动)5/8<< endl;
std :: cout<<还有一个非常大的数字:\ t";
std :: cout<< (双)7000 * 7000<<
endl;
std :: cout<<别忘了用您的名字.. \ n替换Francois Bitas;
getchar();
返回0;
}
hello everybody,
just was working on this code that i need to compile but it gives error messages saying ''endl'' : undeclared identifier
here is my code
#include <iostream>
int main ()
{
std::cout << "Hello there. \n";
std::cout << "here is 5: " << 5 <<"\n";
std::cout << "The manipulator endl writes a new line to the screen.";
std::cout <<
endl;
std::cout <<"Here is a very big number :\t" << 70000 << endl;
std::cout <<"Here is the sum of 8 and 5:\t" << 8+5 << endl;
std::cout <<"Here is a fraction :\t\t" << (float) 5/8 << endl;
std::cout <<"And a very very big number :\t";
std::cout << (double) 7000*7000 <<
endl;
std::cout <<"dont forget to replace Francois Bitas with your name ..\n";
getchar ();
return 0;
}
推荐答案
尝试添加:
Try adding:
using namespace std;
或尝试:
Or try:
std::cout << std::endl;
我很确定endl在std名称空间中,因此您必须完全限定它或导入名称空间.
I''m pretty sure endl is in the std namespace, so you either have to fully qualify it or import the namespace.
这篇关于错误1错误C2065:"endl":未声明的标识符的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!