Need of main function in C, used in microcontrollers -


i have been using c embedded systems while, have question regarding main() function.

when microcontroller boots up, control first reaches reset handler, control goes whichever function need to. if not using initialization code provided compiler library, can keep calling whichever function to. then, why need main()? ide (codewarrior) insists on having main() though. ideas?

as per c99 standards not mandatory have main function 'freestanding' environment. in micro-controllers start-up initialization code called reset vector.this code performs global variable initialization,stack initialization etc. , jumps main function.

you can modify start-up vector location or start-up code itself. can decide not call main function start-up code.

if using own start-up code please make sure ide settings set not generate start-up code.


Comments

Popular posts from this blog

How has firefox/gecko HTML+CSS rendering changed in version 38? -

javascript - Complex json ng-repeat -

jquery - Cloning of rows and columns from the old table into the new with colSpan and rowSpan -