2 ms·
The convention is for UNIX processes to return 0 on success and a non-zero value (often 1) on failure. This means that the UNIX shell "if" statement tests to se
by geofft 10y ago
The convention is for UNIX processes to return 0 on success and a non-zero value (often 1) on failure. This means that the UNIX shell "if" statement tests to see if the return value of the program it runs is zero. Therefore, the UNIX "true" command is int main() {return 0;} and the "false" command is int main() {return 1;} -- despite the C convention being the exact opposite.