This is probably a stupid question, but I always wonder what is the standard.
In most (not all) of the first C ++ examples, you can see that the main function returns 0. Does this mean that the operation went well or not?
What is the standard way to do this?
By the way, is it better to return an integer or a logical number in this case?
Thanks guys!
0 EXIT_SUCCESS . EXIT_FAILURE . . , std::exit(1) return 1; , .
0
EXIT_SUCCESS
EXIT_FAILURE
std::exit(1)
return 1;
EXIT_SUCCESS EXIT_FAILURE <cstdlib>.
<cstdlib>
: , , :
GNU make :
, , . :
0 - , . int . main() C ++?
C . , 0 . , .
++. ( ). - int, .
, (, , , POSIX, )
0, "" "". , , - other than 0, . , read(), , , , , . , 0, , . .
other than 0
read()
S_OK
CreateFile
int
bool
. , , . ; , , , . , . 0, " ".
, , 0 - . , ... .
C/Unix.
script, script , . , 0 .
C , . .
, , , C/++ , , , ( ), .
, , /, 0 1 . , , enum, - -, , .
enum