What type of function is main()?
Library functions are functions that somebody else coded, and are available for use.

User-defined functions are functions that the user defines. This is the case of the C/C++ main().

You can think of main() as a placeholder or hook. The user supplies it, but the standard library knows to call it after initializing itself.