0

I didn't usndertand the point of return 0. I tried the code without it, and it works fine.

So is it important?

23rd Apr 2018, 12:16 PM
Robin
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.
23rd Apr 2018, 12:22 PM
Akib
Akib - avatar
0
yes its important function that's returns value
23rd Apr 2018, 12:48 PM
Jeya Prakash J
Jeya Prakash J - avatar
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
23rd Apr 2018, 1:21 PM
Vamoss
Vamoss - avatar
23rd Apr 2018, 2:35 PM
KrOW
KrOW - avatar