Possible Duplicate:
does c++ standard prohibit the void main() prototype?
Why is C++ not letting me do void main()
? It's not much of a problem, but I'm still curious.
Because return type of main()
(as mandated by the Standard) must be int
C++03 [Section 3.6.1
Main function]
An implementation shall not predefine the main function. This function shall not be overloaded. It shall have a return type of type int, but otherwise its type is implementation-defined.
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