+ 2

Return 0

If you begin with " int main" does the compiler automatically fill in " return 0" at the end? I know it works on sololearn but does it work when you are creating actual programs from scratch?

7th May 2019, 10:32 PM
Kevin Hoover
Kevin Hoover - avatar
2 Réponses
+ 7
Yep `return 0` is automatically returned for you if you don't do it. That only works for the main function though.
7th May 2019, 11:01 PM
Schindlabua
Schindlabua - avatar
+ 5
I don't believe so but maybe this is compiler dependent. E.g. on code playground it seems to work without return. https://code.sololearn.com/c77G1t0jI80D/?ref=app
7th May 2019, 10:42 PM
Sonic
Sonic - avatar