+ 1
what if we end program with return 1;
why do we end program with return 0; why don't anything else
3 Antworten
+ 2
nothing.. its the same
+ 2
If your program returns a non-zero value, you mean to indicate some kind of error. If you launched the program by itself, it doesn't really matter, but if you launched it with a script, it gets the return value, and you can deduce the error from the number returned and do stuff depending on it. Which return value indicates which error is entirely of your choosing.
+ 2
Yes..... nothing will happen. you can return any value to a function.