Along with a couple of others, the following are valid prototypes for main()
:
int main(void)
int main(int, char**)
In C we can't overload functions so it's never possible to have both. But in C++ that's not true. If I were to have both in a compiled C++ executable, then which one is used? Does it depend on the command line? What does the standard say?
C++11 §3.6.1/2:
” This function shall not be overloaded.
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