Structure of a C++ Program
1.) Header file (Include file)
2.) Member function definition
3.) Class declaration
4.) Main function
1. Header File:
In this section, we add header files and resource files. These files provide definition for function and object used in a program.
2. Member Function Definition:
In this section class member, function and other functions are defined.
Ex:
demo :: fun()
{
Definition
}
3. Class Declaration:
In this area class is defined.
Ex:
class demo
{
Member variables and functions
};
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;
}
1.) Header file (Include file)
2.) Member function definition
3.) Class declaration
4.) Main function
1. Header File:
In this section, we add header files and resource files. These files provide definition for function and object used in a program.
2. Member Function Definition:
In this section class member, function and other functions are defined.
Ex:
demo :: fun()
{
Definition
}
3. Class Declaration:
In this area class is defined.
Ex:
class demo
{
Member variables and functions
};
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;
}