I have been spanked by certain commenter (who shall not remain anonymous 😉 ) on here and FB about my style of naming unused
mainarguments and unnecessary
return 1;at the end of every
mainfunction.
I have though about and I… concede the point of his argument 🙂 From now on the style on this blog shall be as follows (if arguments to
mainare not needed):
int main()
{
// CODE...
}
P.S. C++ standard allows for two valid signatures:
int main()and
int main(int argc, char** argv), see here.
Why “return 1” ? “return 0” is usually used to report success and other numbers indicating error codes.