3 ms·
Depends 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
by david-given 11y ago
Depends 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.