3 ms·
You're right that it should be int main() to be valid C++: 2 An implementation shall not predefine the main function. This function shall not be overl
by Jach 15y ago
You're right that it should be int main() to be valid C++:
2 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.
But note:
5 A return statement in main has the effect of leaving
the main function (destroying any objects with auto-
matic storage duration) and calling exit with the
return value as the argument. If control reaches the
end of main without encountering a return statement,
the effect is that of executing
return 0;
The other two points I disagree with. =P