C++ Programming Basics

 

C++ Programming Basics

Functions:

  Functions are one of the fundamental building blocks of C++. The every program must consists single function called main().

  Syntax of user defines function is as below:

1.    return_data_type function_name(argument list)

2.    {

3.         // Body part of user define function

4.    }

          Line number 1 indicates the function header.

        Line number 2 and 4 indicates the begin and end using ‘{‘ and ‘}’ respectively. More than one statement is called as Block of statements which must be enclosed in the begin and end.

      The body of a user-defined function can contain any number of statements, at least one statement. That must be enclosed in the begin and end.

main function header can be write in many ways.

Comments