++ main() int. , , , ( 0 ), .
I will give a specific Microsoft example, but it shows the general need to return an error code: ProcessA needs to create a ProcessB and wait for it to complete, after which it wants to check if ProcessB has been processed successfully. ProcessA will use the CreateProcess function to create the ProcessB, then it will use the ProcessB handle to wait for it to complete, and then it will use GetExitCodeProcess to get the ProcessB termination code - which is the int value returned from main ().
source
share