0
Return 0
The further I go along in the C++ lessons the less that return 0 is used at the end of the code. If my understanding is correct the program will return a value upon completion regardless of successful completion. Is the return 0 supposed to be implied? I would think that it would be good programming practice. Thank you for any insight.
4 odpowiedzi
+ 1
Maybe the function main() is starting as void main() which do not need anything to return when the program ends because of void datatype.
0
return 0 is typically used to indicate the successful completion of the program. C++ specifically allows you to fall off the main() function without explicitly returning anything. The compiler automagically includes a return 0; there.
0
You might also check here...
https://www.sololearn.com/discuss/1875406/?ref=app
https://www.sololearn.com/discuss/319465/?ref=app