The range of [-32,767, +32,767] for an int is only the minimum range guaranteed by the standard. It would only usually be that limited on a 16-bit system. (And even there the lowest value would be -32,768 for a two's complement machine.)
Try running this on your system.
Code:
#include <stdio.h>
#include <limits.h>
int main() {
printf("SHRT_MIN: %20d\n", SHRT_MIN);
printf("SHRT_MAX: %20d\n", SHRT_MAX);
printf("USHRT_MAX: %20u\n", USHRT_MAX);
printf("INT_MIN: %20d\n", INT_MIN);
printf("INT_MAX: %20d\n", INT_MAX);
printf("UINT_MAX: %20u\n", UINT_MAX);
printf("LONG_MIN: %20ld\n", LONG_MIN);
printf("LONG_MAX: %20ld\n", LONG_MAX);
printf("ULONG_MAX: %20lu\n", ULONG_MAX);
printf("LLONG_MIN: %20lld\n", LLONG_MIN);
printf("LLONG_MAX: %20lld\n", LLONG_MAX);
printf("ULLONG_MAX: %20llu\n", ULLONG_MAX);
return 0;
}
I get:
Code:
SHRT_MIN: -32768
SHRT_MAX: 32767
USHRT_MAX: 65535
INT_MIN: -2147483648
INT_MAX: 2147483647
UINT_MAX: 4294967295
LONG_MIN: -9223372036854775808
LONG_MAX: 9223372036854775807
ULONG_MAX: 18446744073709551615
LLONG_MIN: -9223372036854775808
LLONG_MAX: 9223372036854775807
ULLONG_MAX: 18446744073709551615