I'm simply trying to start learning C++, and this hello world thing isn't working. What's wrong with the code? This tutorial says I'm doing it right, but it keeps telling me line 5 is wrong.
#include %26lt;iostream.h%26gt;
int main()
{
cout %26lt;%26lt; "Hello World!\n";
return 0;
}
What's wrong with this C++ program?
Make the cout line the following:
std::cout %26lt;%26lt; "Hello World!" %26lt;%26lt; std::endl;
Reply:you forgot to add the line : using namespace std;
under the include directive
this lets the compiler know what cout means
Reply:If you are using Visual C++ compiler, then try
#include "iostream.h"
Subscribe to:
Post Comments (Atom)
No comments:
Post a Comment