Answer the question
In order to leave comments, you need to log in
Return value of Main and other methods?
Hi all! It is very interesting to learn about the return value of Main and other methods. As I understand it, if you specify as a return. value void type, then the function will in any case return the value 0 to the OS (which means successful completion "without errors" of the software). Those. if you specify void , then Main will always return 0 regardless of the "success" or "failure" of completion? How does this rule affect other methods? As I assume, only Main returns 0 anyway, and other methods, when specifying the void type, do not return anything (as they should). Right?
Thanks in advance!
Answer the question
In order to leave comments, you need to log in
Main is just an entry point, a spherical horse in a vacuum. However, this "horse" cannot exist by itself and lives inside the process. The process just returns code 0. We can only tell the process what code it should return upon completion. This is if in a nutshell.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question