We know that the function main() is the starting execution point of every C/C++ program. The main() can be used as a member function of the class. But the execution of program will not start from this member function. The compiler treats member function main() and the user-defined main() differently. No ambiguity is observed while calling function. The following program narrates this concept.
8.36 Write a program to make main() as a member function.
cout<<endl<<“In member function main()”;
In member function main()
Explanation: In the above program, class A