Possible Duplicate:
What is the valid range for program return value in Linux/bash?
Here is a simple c program:
#include <stdio.h>
int main(){
int a=0, b=100;
while(a<=b){
printf("%d\n",a);
a+=10;
}
return a;
}
Checking the return value on linux gives 110 which is expected as the last expression evaluated in the program is assignment of 110 to a; But when I replace b=100 with something greater than 256 say b=260; the return value is 14 and not 270 which was expected. Why does returned value wrap around 256 when main is supposed to return integer whose range is far more than 256?