

Std::cout << "I'm a C++ program" // prints I'm a C++ program

Std::cout << "Hello World! " // prints Hello World! With more comments */ #include int main () But C++ does not have strict rules on indentation or on how to split instructions in different lines. The program has been structured in different lines and properly indented, in order to make it easier to understand for the humans reading it.

The execution of all C++ programs begins with the main function, regardless of where the function is actually located within the code. The function named main is a special function in all C++ programs it is the function called when the program is run. Functions will be discussed in detail in a later chapter, but essentially, their definition is introduced with a succession of a type ( int), a name ( main) and a pair of parentheses ( ()), optionally including parameters. Essentially, a function is a group of code statements which are given a name: in this case, this gives the name "main" to the group of code statements that follow. Line 4: int main () This line initiates the declaration of a function. They simply improve readability of the code. In this case, the directive #include, instructs the preprocessor to include a section of standard C++ code, known as header iostream, that allows to perform standard input and output operations, such as writing the output of this program ( Hello World) to the screen. They are special lines interpreted before the compilation of the program itself begins. Std::cout Lines beginning with a hash sign ( #) are directives read and interpreted by what is known as the preprocessor. my first program in C++ #include int main()
