+ 3
what is the role of main() in cpp?
Please help me how important role is main function in cpp.
3 Answers
+ 9
It's simply a entry point where actually exicution of the program begins.. irrespective of number of methods u included!
The main function is called at program begining after initialization of the non-local objects with static storage duration. It is the designated entry point to a program that is executed in hosted environment (OS). The entry points to freestanding programs are implemented defined.
+ 2
it is just an entry point to execute a program.
os need to know where to start a program
0
Abhishek Kumar
This is called function.
Any code inside its curly brackets {} will be executed.
main() function is the starting point of any C++ program