The main
function is called in practice at run time C.
You can write a program without main
, but it must have an entry point. Different operating systems allow you to specify different entry points for your program, but they all perform the same task as main
. On Windows, you can use WinMain
. On Linux, you can reference without CRT and define your own _start
function (but it cannot return!)
A program without an entry point is like a car without wheels: it will not go anywhere.
source share