Structure of C++ Program:
·
Include file
·
Class declaration
·
Member function definition
·
Main function
1. Include
File:
In this section, we add header files and resource files.
These files provide definition for function and object used in a program.
2. Class
Declaration:
In this area class is defined.
Ex:
class demo
{
Member
variables and functions
};
3. Member
Function Definition:
In this section class member, function and other functions
are defined.
Ex:
demo :: fun()
{
Definition
}
4. Main
Function:
This is special type of function that is called at the
beginning of program execution. Each program must have one main function.
int main()
{
return 0;
}
0 comments:
Post a Comment