What is so special about main() function in C? In my embedded C compiler it tells the program counter where to start from. Whatever appear first (as instruction) into main function it will be placed first in the flash memory. So what about PC programs? What is the meaning of main() when we program for PC?
On a hosted implementation (basically, anything with an operating system), main is defined to be the entry point of the program.  It's the function that will be called by the runtime environment when the program is launched. 
On a freestanding implementation (embedded systems, PLCs, etc.), the entry point is whatever the implementation says it is.  That could be main, or it could be something else.  
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With