cout and friends are defined in the namespace std. Also, the iostream header file does not have the .h on it any more. Prior to standardisation these things were not always the case, so perhaps your sample code was written from guidelines which predate the implementation of the standard.
To use things which are defined in a given namespace, you can either prefix the name of the thing with
namespace:: or you can include a
use namespace ... statement, which will bring things from that namespace into the global namespace. For example, either of these should work:
Code:
#include <iostream>
using namespace std;
int main()
{
cout << "Hello world" << endl;
return 0;
}
or:
Code:
#include <iostream>
int main()
{
std::cout << "Hello world" << std::endl;
return 0;
}