Like all the others, here we go!
Code:
#include <iostream>
int main()
{
std::cout << "Hello worldn";
return 0;
}
The first line, "#include <iostream>" includes the library iostream, which is used later, for the command "std::cout". If we removed it, we would get that "std" isn't an class or namespace, and that "cout" has an undeclared identifier (std).
The next line, "int main()" creates the main function, this function is needed in EVERY C++ program.
Next line, "{" shows where the main() function start.
Next line, "std::cout << "Hello world!n";
"std" is the identifier for "cout", without "std::" infront of it, we would get a nasty error. We could actually have added "using namespace std;" after "#include <iostream>", and we wouldn't have to use "std::" anywhere in our program. "cout" is used to show something on the screen. "<<" Those two are needed before we show something on the screen, and the next i'm sure you can guess what does. The "n" part specifies a line-break. Instead of "n", we could've used "std::cout << "Hello world!"
std::endl;" which makes it end the line (endl = end line).
The next line, "}" closes the main() function.
That was the legendary Hello World program in C++.