0
In the simple program of hello world i tried 'return x' (x taking any value) instead of return 0 still it is working.Why?
3 ответов
+ 15
every function except void functions return a value it dependent in the function type which type of data it will return
and int main() is also a user define function which is of integer type so it will return int value
return 0 is written at the end of function for avoiding garbage returns by main () function
+ 2
Yes, it is true. Because this returned value is not usually checked at all. But could be. In case you pass your program to another users (as coomercial, for example), they can check it . So the basic suggestion is :
When you return another value from function main, write it in to program doceumentation or help....