answersLogoWhite

0

Any program source has to identify a memory location as the start of the program. The OS transfers control to this point of the program or module.

In case of C programs, the starting module is NOT your program, but another initialisation routine, which has name lis c0s.obj, c0l.obj etc. This routine after doing initial housekeeping work, like storing program name, arguments, environment variables etc. in the stack, calls a routine by name main.

How else are we going to tell the OS where to start ?

At the end of executing the main() function, the control goes back to the routine from which the main was called and then to OS, which terminates the program.

User Avatar

Wiki User

14y ago

What else can I help you with?