Remix.run Logo
veltas a day ago

I feel the same way about C/C++ having default return of 0 in main() only.

kazinator a day ago | parent [-]

I 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 a day ago | parent [-]

I write "return EXIT_SUCCESS;" maybe that constant might change... :-)

veltas a day ago | parent [-]

0 is guaranteed to mean 'success', although not guaranteed that it's equal to EXIT_SUCCESS, so you can always use 0.