RE: Hello World

You are viewing a single comment's thread from:

Hello World

in programming •  7 years ago 

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;
}
Authors get paid when people like you upvote their post.
If you enjoyed what you read here, create your account today and start earning FREE STEEM!
Sort Order:  

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.