Quote:
Originally Posted by Saint
I'm using g++ in Redhat linux and I have code like this:
Code:
#include <iostream>
int main()
{
cout << "Hello World!";
return 0;
}
but I get a count undeclared. Does iostream not have cout in it?
|
Your error is probably "cout undeclared". cout is located in the std namespace, so your coude needs to either be
Code:
#include <iostream>
int main()
{
std::cout << "Hello World!";
return 0;
}
or
Code:
#include <iostream>
using std::cout;
int main()
{
cout << "Hello World!";
return 0;
}