by RandomInteger4 · 8y ago · 0 comments
int main (int argc, char* argv[]) {
return 0;
}The concept of using 0 to mean false is not new to javascript is what I was getting at.
Not necessarily. It's just a (mostly POSIX and Linux kernel) convention to use 0 as "no error" result, but there are plenty of code that returns 0 as an error and >0 for success. It has nothing to do with C language itself, as C functions let you return pretty much anything or nothing at all (void functions).
In a shell, for example, the 0 exit status is normally actually truthy:
$(exit 0) && echo hello