With respect to memory layout for a C program to run, is the stack memory is responsible for calling the main function?
With respect to memory layout for a C program to run, is the stack memory is responsible for calling the main function?
The stack has nothing to do with it. As for section 5.1.2.2.1 of the C99 draft standard, it can be found here
In essence, the system must behave as if the operating system called main to start the program. In practice, the OS usually calls another function which performs startup tasks and then calls main.
The cost of software maintenance increases with the square of the programmer's creativity. - Robert D. Bliss
Thanks for the reference.
I understand that the main function call is handled by the OS execution env and the information regarding this call is stored in the stack memory.Am I right?