0

What is "return 0;" form?

Why do i need to put return 0; ???

14th Oct 2016, 8:10 PM
kenny
3 Answers
+ 6
Short answer: just put it and forget about it. Long answer: the value returned by the program can be used if it was launched by another program. A return value of 0 means no error, and a non-zero return value means any error of your choosing. You can then do things differently in the host program depending on that return value. Needless to say, that feature is seldom used.
14th Oct 2016, 9:06 PM
Zen
Zen - avatar
+ 1
if u have multiple conditions and they interfere each other then type "return 0 ;" explanation :- it return to its 0 value and no further evaluate conditions below u r required condition......
15th Oct 2016, 6:24 PM
Jay Patil
Jay Patil - avatar
0
thanks xD
14th Oct 2016, 9:42 PM
kenny