a C-programm can fail to execute under special circumstances in Linux. Example: You allocate some space and the OS denies it.
char *buffer = (char *) malloc
The exit code on UNIX/Linux from a process, the return statement in main() or a call to exit(), is unsigned in the range 0 - 255.
From a function it can be any type you want it to be. Many library functions return -1 on error.
However that is not always possible, particularly functions that normally return a pointer. By convention those functions return NULL on error, examples are fopen() and malloc().
These return codes only indicate that an error has occurred, not what the error is, usually (on error) the global errno is also set to a positive error code giving further information. See man errno