Structure of C++

Structure of C++



 
Line 01 : //my first program in C++
Two slash signs indicate that the rest of the line is a comment inserted by the programmer but which has no effect on the behavior of the program. programmers use them to include short explanations or observations concerning the code or program. in this case, it is a brief introductory description of the program

Line 02 : #include<iostream>
Lines beginning  with a hash sign(#) are directives read interpreted by what is know as the preprocessor. They are special lines interpreted before the compilation of the program itself begins. In this case the directive #include<iostream> instructs the preprocessor to include a section of standard C++ code know 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.

Line 03 : using namespace std;
All the elements of the stranded C++ library are declared with in what is code a namespace. In order to access is functionalities we declare with this expression that will be using this entities.

Line 04 : int main()  
This line initiates the declaration of a function 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 their definition is introduced with a succession is a type(int) , a name (main) and a pair parentheses () , optionally including parameters.

Line 05 and 08 : { }
The open brace ( { ) at line 5 indicates the beginning of main’s function definition, and the closing brace ( } ) at line 8 indicates its end everything between these braces is the function’s body that defines what happens when main is called. All functions use braces to indicate the beginning and end of their definitions.

Line 06 : cout << “HELLO WORLD” ;
This statement with a simple or compound expression that can acutely some expect on screen. “cout” represented the stranded output stream and the meaning of the entered statement. Is to insert the sequence of characters into the stranded output stream terminate end by ;

Line 07 : return 0;
The return statement pause the main function to finished a return or is commonly 0.

do you have any qustion please comment



click the advertisement to help for me ....  












Comments

Popular posts from this blog

Sample Qustion 11

Sample Qustion 1

Sample Qustion 5