0

What is the purpose of return 0 at the end?

12th Jun 2017, 9:42 AM
Lek0
Lek0 - avatar
5 odpowiedzi
+ 12
The function is something like : int main() {} This means it must return and integer... (0 or any other numeric value). The code fails if no int is returned....
12th Jun 2017, 9:48 AM
Valen.H. ~
Valen.H. ~ - avatar
0
return 0 = Succesfull
12th Jun 2017, 9:48 AM
Andrés04_ve
Andrés04_ve - avatar
0
okay thanks :)
12th Jun 2017, 9:51 AM
Lek0
Lek0 - avatar
0
if you use "return" with any number other than 0, it will send the program with an error. even if it works just fine. it will recognize that its errored.
17th Jun 2017, 12:31 AM
Sonny Fragoso
Sonny Fragoso - avatar
0
but doesn't the code do just fine even without return function. I'm not sure why we use it though. it's like blowing on a car to make it go faster, it'll do just fine.
18th Jun 2017, 3:34 PM
Lek0
Lek0 - avatar