Here is the code that I ran on Mac OS X (10.8.1, 64-bit and 10.6.8, 32-bit) and Ubuntu (10.04, 32-bit):
printf("%d\n", atoi("2147483648")); // returns -2147483648 in Mac OS X 10.8.1 and 10.6.8 // returns 2147483647 in Ubuntu
Here is what I found after some Googling: http://gynvael.coldwind.pl/?id=365
Is there a reason why the output depends on different systems?
source share