16.1 The main Function
The identifier main
is special. It is must be used as the
name of a function that will be the first function to execute in a program. You must always
have one and only one function called main()
in your programs. Code
associated with main()
, is not the first code to execute after Reset.
Additional code provided by the compiler and known as the runtime startup code is executed
first and is responsible for transferring control to the main()
function.
The prototype that should be used for main()
is as
follows.
int main(void);