0
#include <iostream>

using namespace std; //error here

int main()
{
    cout << "COME AT ME BRO!\n"; //error here
    return 0;
}

cout は識別できません。以前にこの問題が発生しましたが、コンパイラが機能しなかったため、IDEBean を再インストールしたところ、同じ問題が再び発生しました。ヘルプ :?

4

2 に答える 2

0

coutstd名前空間内にあります。したがって、使用する必要があるstd::cout<<"...";か、他のオプションはusing namespace std;最初に行うことであり、次に使用できますcout<<"...";

于 2011-03-16T05:05:37.377 に答える
0
 std::cout << "COME AT ME BRO!\n";

coutstd名前空間で定義されています。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;
}
于 2011-03-16T05:06:22.147 に答える