I'm pretty sure the C standard does not specify which value (e.g. 0) is for success. I think that's up to the OS/environment, but *nix systems generally use 0 for success. The standard does however define two macros, EXIT_FAILURE and EXIT_SUCCESS that are safe and portable, and probably your best bet. Another thing to note, main is always specified as returning int, but the OS/environment may interpret that as signed or unsigned, and as a char, short or int. E.g.
Code:
$ cat foo.c
int main(void)
{
return -1;
}
$ gcc -Wall foo.c -o foo
$ ./foo
$ echo $?
255
Linux interprets the return code as a signed char. Not sure what windows does.