3 ms·
I feel the same way about C/C++ having default return of 0 in main() only.
by veltas 1y ago
I feel the same way about C/C++ having default return of 0 in main() only.
- kazinator 1y agoI really hated that change when I came out. I'm still not a big fan, but I made my peace with it understand that it benefits the poor users who have to deal with programs whose termination statuses are pseudo-random. Especially users doing scripting. I write "return 0" at the end of main in all my programs if that end is reachable.
- 1718627440 1y agoI write "return EXIT_SUCCESS;" maybe that constant might change... :-)
- veltas 1y ago0 is guaranteed to mean 'success', although not guaranteed that it's equal to EXIT_SUCCESS, so you can always use 0.