logoalt Hacker News

mpyneyesterday at 10:55 PM1 replyview on HN

C++ also special-cases the `main` function. Probably because `main` is the interface to the OS so it gets special language treatment.


Replies

mitxelatoday at 12:50 AM

In C++ you're not allowed to call main yourself, so that the compiler can call the global constructors at the start of main.