What happen if we se return 1; in place of return 0; | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 4

What happen if we se return 1; in place of return 0;

C++

16th May 2019, 4:43 PM
SK@123
SK@123 - avatar
2 Answers
+ 8
return n; from your main entry function will terminate your process and report to the parent process (the one that executed your process) the result of your process. 0 means SUCCESS. ...returning different values like return 1or return -1 means that program is returning error
16th May 2019, 5:04 PM
Why So Serious ?
Why So Serious ? - avatar
+ 5
0 means the program executed without any problems. If you put 1, it means there was an error. It doesn't matter unless another program runs your program and wants to know if it executed correctly.
16th May 2019, 4:51 PM
inxanedev!
inxanedev! - avatar