Please read his response.
He told you to put
Code:
using namespace std;
after the #include part.
The reason you got that error was because cout was not qualified.
You can have a few different styles to it:
Code:
//Method 1
#include <iostream>
using namespace std;//qualifies all names to be in namespace std
int main()
{
cout << "Hello, World!" << endl;
return 0;
}
Code:
//Method 2
#include <iostream>
using std::cout;
using std::endl;//pre-qualifies cout and endl
int main()
{
cout << "Hello, World!" << endl;
return 0;
}
Code:
//Method 3
#include <iostream>
int main()
{
std::cout << "Hello, World!" << std::endl;//inline qualification
return 0;
}
I've heard people argue that method one is not the best to use, because it defeats the whole purpose of having a namespace, but I use it anyway (and just put using namespace ____ when I need to use a different namespace).