Possible duplicates:The main () function returns a value?What should main () return to C / C ++?
What is the purpose of returning a value from main () in C and C ++?
How does the return value help us?
Is it possible to use the return value to achieve something important?
This is exit status . It is usually used to signal in the OS whether the process was successful or not in what it was doing.
Indicates the status of program execution. Usually zero means that it went fine.
, , . , , .
. , bash $? . , && || , , , :
$?
&&
||
# Fetch the images, and only process them if the fetch succeeded (return code 0). fetch-images && process-images
In a command-line environment, a return value means success or failure in starting the program. This way you can share status information with the caller. Zero is reserved for success on Unix.
A more detailed answer can also be found here. More details
Source: https://habr.com/ru/post/1789037/More articles:Like dynamic realloc global variable with c - cError trying to use Ruby on Rails - ruby | fooobar.comRegexp to add and remove text before completing a file - javascriptIn Java, what is the difference between the following declarations? - javaiPhone, what is the size of the icon / button bar of a UITableView? - iphoneIn spring mvc, headers = "x-request-with: XMLHttpRequest" in the request do not work? - ajaxКак добавить байт [] в список? - javaReturns the value of the main () function? - cjQuery ajax not working in iOS - javascriptHow to find the number of database requests by application - javaAll Articles