The version of Hello World you've shown is from the older pre-ISO version of C++, this is evident by the .h on the end of iostream and the lack of the std namespace.
The ISO version of Hello World in ISO C++ from the Hello World Collection site again is:
// Hello World in ISO C++
#include <iostream>
int main()
{
std::cout << "Hello World!" << std::endl;
}
When I used to program in C++ we'd do the following to deal with the std namespace in a different way, but it may not be considered good practice:
// Hello World
#include <iostream>
using namespace std;
int main()
{
cout << "Hello World!" << endl;
}
Good spot, sir! I am still trying to get used to the editor... there seem to be a couple things that got erased when I removed blank lines. Also... C++ is not my language of choice in real life... otherwise things might have dawned on me earlier.
Downvoting a post can decrease pending rewards and make it less visible. Common reasons:
Submit