PHP Code:
#include <iostream>
using namespace std;
int main(int argc, char* argv[]){
cout<<"Hello World";
}
every traditional programming tutorial starts off with Hello World :-)
It's meant to show you the complexity of a programming language and you should try to understand the hole Hello World programm
PHP Code:
#include <iostream>
this statement includes the iostream library to provide some functions like cout.
PHP Code:
using namespace std;
this statement allows you to use members of the std name space without typen std:: before them, the cout function belongs to the std namespace
PHP Code:
int main(int argc, char* argv[])
This is the main function header, all C++ programms start here, as you can see this function takes some arguements, int argc is the count of arguements and char* argv[] is the array that contains the arguments, argv[0] is always the name of your executable.
PHP Code:
{
cout<<"Hello World";
}
this is the body of the main function, it's enclosed by '{' and '}', all function bodys are enclosed by these two symbols, the line cout<<"Hello World"; prints a string in your console, << is an operator used by cout, all iostream functions use this operator to show where the stream goes to.