Re:C++ main function doesn't need return but has int return ...
by DamonHD on Wednesday January 29, 2025 @03:51AM
(#42862916)
So as to avoid accidentally returning a random (bad) status code for the whole process in the case where no explicitly return is coded. Equivalent to allowing a void return type in C I guess, but maybe less smelly given that the process does actually return something, typically, eg in POSIX environments.
[ Parent
| on HN ]
There are no comments on this comment yet.