On Sat, Nov 17, 2007 at 05:46:04PM +0800, 任晓磊 wrote: > 另外,如果unsigned的话,最大数字会比signed小,而非再乘2
不可能。 $ cat int-range.c #include <stdio.h> #include <limits.h> int main( void ) { printf( "The length of int is %zd bytes.\n", sizeof( int ) ); printf( "The maximum signed integer is %d.\n", INT_MAX ); printf( "The maximum unsigned interger is %u.\n", UINT_MAX ); return 0; } $ gcc -std=c99 -o int-range int-range.c $ ./int-range The length of int is 4 bytes. The maximum signed integer is 2147483647. The maximum unsigned interger is 4294967295. Ming 2007.11.17