+ 1
what if at the end of the program I write return 1; instead of return 0; what would happen to my program after compilation
3 Respostas
+ 1
returning a 1 instead of 0 from the main will have no impact on your program. but if your program is used by another one, receiving a one as return code will make it assume that something went wrong and who knows the consequences of such a bad assumption. ..
0
it will return 1
- 1
Try out. You will never know what will happen and how program works if you are not trying and doing mystakes. Of corse some of them is better to not be tryed but things like this... You can play with it ;)