+ 2
I new to c programming, but there's a concept I misss
I noticed the part of "return 0" in coding and I understand what it means , but if the program didn't return 0 - because it wasn't executed successfully- and returned a different number ... what else could it return in this case ? And if it's more than one number - more than one possibility - , does every number indicates a type of error that I should fix ? And finally is there another numbers - or generally values - could it return and be considered "successfully executed" in other forms of coding in c ? And if there is , what's the difference between them ? I know it's lot of questions there but actually I have got a homework about this topic and I feel that the google search doesn't understand me ^^' . Thanx in advance ^^
1 Antwort
+ 3
return 0 - program executed successfully
return -1 or any number - something error in code
I don't think every different number means types of errors , number different from 0 all only means there is a error in code
Some tips on it
https://www.geeksforgeeks.org/c-function-argument-return-values/