I wrote this because I am learning about linux and return values and such, and I wanted to try some stuff with
The program is nothing but a return value
Code:
#include <stdio.h>
int main()
{
return 1;
}
Now, if x (the return value) is positive and less than 255, $? = x
if x is negative, is returns some [positive value that apparently counts down from 255, ei -1 prints 255, -2 prints 254, etc. And going aove 255 seems to start looping back around to 0. Is this just a linux convention that restricts returns values to something between 0 and 255 to keep tings simple? Don't a lot of programs use negative values to indicate an error? How does this work if the values are forced into a positive?