It's user-defined: you define it in each program. If it were a library function, you wouldn't define it, because the library would define it for you.
(As an exception to this, the Unix libraries libl
and liby
, the support libraries for Lex and Yacc, actually define main
; the idea is that you define a bunch of functions with standard names and you get a default main
that calls these functions. You can override their main
, though. Apparently Windows compilers do something similar.)