4 ms·
return 0 in main hasn't changed, it is still not needed.
by Tomte 11y ago
return 0 in main hasn't changed, it is still not needed.
- david-given 11y agoDepends on your definition of 'needed' --- if you don't return 0 from main, your program will exit with an undefined status code, which means that if you use it from a shell script or makefile weird things might happen because your program may be considered to have failed.
- Narishma 11y agoNo, if you don't return anything from main, return 0 is added for you by the compiler, at least in C++ and recent versions of C.