Why has setting the entry point's return type to void
in C++ always been discouraged, and was later removed by the standard and is prohibited by modern compilers? Why is it considered bad practice?
Now, as I understand C# and Java both allow the entry point's return type to be void
i.e
static void main(String[] args) /* Java */
static void Main(string[] args) /* C# */
And C# and Java programmers do not consider it bad practice, they use it often in fact.
Other languages which are (only intended to be, I doubt C++ will be succeeded in this decade, at least) possible successors of C++ like the D Programming Language or Vala also allow a void main()
. So as you can see, I doubt the C++ community removed it from the standard because it was too obscure or unpopular.
So my question is, Why did the C++ Community Remove void main()
? What was wrong with it?
void main()
: there is no result from a program. In additionvoid main()
wasn't removed: it was never added. – Arsonist