看下它们在32位编译器下取值范围,先了解下:
32-bit data types, sizes, and ranges
Type Size (bits) Range Sample applications
unsigned char 8 0 <= X <= 255 Small numbers and full PC character set
char 8 -128 <= X <= 127 Very small numbers and ASCII characters
short int 16 -32,768 <= X <= 32,767 Counting, small numbers, loop control
unsigned int 32 0 <= X <= 4,294,967,295 Large numbers and loops
int 32 -2,147,483,648 <= X <= 2,147,483,647 Counting, small numbers, loop control
unsigned long 32 0 <= X <= 4,294,967,295 Astronomical distances
enum 32 -2,147,483,648 <= X <= 2,147,483,647 Ordered sets of values
long 32 -2,147,483,648 <= X <= 2,147,483,647 Large numbers, populations
float 32 1.18*10^-38 < |X| < 3.40*10^38 Scientific (7-digit) precision)
double 64 2.23*10^-308 < |X| < 1.79*10^308 Scientific (15-digit precision)
long double 80 3.37*10^-4932 < |X| < 1.18*10^4932 Financial (18-digit precision)