Hello:
(Ubuntu 18.04 gcc version 7.5.0)
Ok... here I thought; "int main()" returned an int. So I tried "return(256)" and bash ($?) reports '0'. "return(255)" reports '255'. Why does main() seem to be limiting to what looks like a CHAR?
And, equally curious, if I try "char main()", the program compiles w/ warning. Using "return('G')" to bash ($?) reports '71', which is decimal for Capital-G.
Recompiling back to int main(), and trying "return(512)" reports '0', and "return(513)" reports '1'. Looks like return(whatever_value % 256) is the behavior.
For my x86_64, using #include <limits.h> reports:
The minimum value of SHORT INT = -32768
The maximum value of SHORT INT = 32767
The minimum value of INT = -2147483648
The maximum value of INT = 2147483647
'Ya learn something every day.......
Thx