0
I didn't usndertand the point of return 0. I tried the code without it, and it works fine.
So is it important?
4 Respuestas
+ 1
Its not necessary in new c++. The compiler now uses return 0 if no return value is assigned. You want to use return if you want a function to return a value of a calculation of some sort. It can be of any data type or any variable/functions.
0
yes its important function that's returns value
0
return 0 means that your program has finished running with success. Other than 0 It mean some exception.
You can also use macro constants that will make your code more portable:
http://en.cppreference.com/w/c/program/EXIT_status
0
Read here:
https://en.wikipedia.org/wiki/Exit_status