+ 1
What is the return 0 statment about?
About Return
7 Réponses
+ 6
return 0 means that the main() function (and the program in general) ended properly. A value other than 0 means abnormal termination.
The compiler adds it at the end if you don't write it, but it's a convention to have it explicitly written there.
+ 3
return 0 used to return the value zero to the operating system
+ 3
the compiler expects some of the return value after the program execution.
it takes 0 as if the program compiled successfully and any other value as unsuccessful compilation.
+ 1
Yes, you can skip the return 0;, but it's good style to have it written in the code
0
The function output
- 2
so we can skip return 0 , since the compiler adds it by default ?
- 5
for fun