I am trying to return a bigger value like 1000 from my main function, but when I type echo $? it displays 0.
If I return a smaller value like 100 it dis
In Unix-land the return value of main is limited because exit there is limited to the range of an 8-bit byte.
In Windows there is a single value, STILL_ACTIVE with value 259, that is best avoided as process exit code.
Other than that, in Windows you can return a 32-bit code such as an HRESULT and that is commonly done.