+ 1
return 0; inside main.
I understand that return 0; in main function indicates that the program is successful, but some compilers do not care. I tried to run it without return 0; and it worked, why ?
3 Answers
+ 2
Hi,
In C++ adding return 0; is optional as the compiler automatically adds a return 0; if you don't explicitly return a value.
The return value is the exit code of a program the shell (or any other application) can read and use it.
Hope this was helpful :-)
0
Thanks
0
@Kourosh Azizi .. Welcome.. đ