#include <iostream>
using namespace std; //error here
int main()
{
cout << "COME AT ME BRO!\n"; //error here
return 0;
}
cout是不可取的。我之前遇到过这个问题,但是我的编译器没有工作,所以我重新安装了IDEBean,并且从第一个方面再次遇到了同样的问题。帮助:?
答案 0 :(得分:0)
cout
位于std
命名空间内。因此,您应该使用std::cout<<"...";
或另一个选项是在开始时执行using namespace std;
,然后您可以使用cout<<"...";
答案 1 :(得分:0)
std::cout << "COME AT ME BRO!\n";
{p> cout
在std
命名空间中定义。因此,您需要在每std::
之前放置cout
。你是如何有选择 -
#include <iostream>
using namespace std ; // Do this if you need include everything defined in the namespace
using std::cout ; // If the program just uses cout of std namespace
int main()
{
cout << "COME AT ME BRO!\n"; // Now you are free from keeping std:: before cout
return 0;
}