C++ PROGRAM STRUCTURE
C++ PROGRAM STRUCTURE
The C++ program structure is divided into two types.
(i) Program structure with class
- C++ headers (Include files)
- Class declaration
- Member function definition (class function definition)
- Main function
Explanation:
1. C++ headers
* It contains the information like prototype, definition and library function.
* Standard headers are specified in a program through preprocessor directive “# include”.
2. Class declaration
Used to declare the class with member Data and functions.
3. Member function definition
* Used to define the functions declared globally or in the class.
* It is used when a program code is divided into small blocks.4. Main function
* It is the starting point of all C++ program.
* This function is called by operating system when your program is executed by the computer.
* Open brace {is the start of a code
* Close brace} is the end of a code
* It has two sub – sections:
1. local declaration
2. executable code
(ii) Program structure without class
Comments
Post a Comment