Novo curso! Todo programador deveria aprender IA generativa!
Experimente uma aula grƔtis+ 3
what is the role of main() in cpp?
Please help me how important role is main function in cpp.
3 Respostas
+ 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