Not stuck or anything, just a question regarding "return 0;"

Is return 0; just used as a method of debugging for the writer?

I’ve noticed in the tutorial, VS is used, and when build is used it returns with all the code, and then “press any key too continue”. Where is the 0 going?

Maybe it is showing somewhere in a console, and that black popup window is what the user will see? If that’s the case, I think maybe I am missing something in xcode that pops up and shows me the end result. When I build, I am viewing my working (or not working) code in the “debug area”

Edit: I think I understand now. In the section where we start using “cin”, the user is asked to input a guess. It was nice to have the last line say “returned 0” and visually see that my program came to a nice, safe end.

it goes to the operating system and is used as an exit status, to say whether the program exited successfully or not.

Privacy & Terms