#include<stdio.h>#include<stdlib.h>int main(){printf("signed char min = %d\n",SCHAR_MIN);//SCHAR_MIN代码就是查看char类型的最小范围,以下同理,均为查看各类型最大最小范围的代码,我就不多说了。printf("signed char max = %d\n",SCHAR_MAX);printf("signed short min = %d\n",SHRT_MIN);printf("signed short max = %d\n",SHRT_MAX);printf("signed int min = %d\n",INT_MIN);printf("signed int max = %d\n",INT_MAX);printf("signed long min =%ld\n",LONG_MIN);printf("signed long max =%ld\n",LONG_MAX);printf("unsigned char max = %u\n",UCHAR_MAX);printf("unsigned short max = %u\n",USHRT_MAX);printf("unsigned int max = %u\n",UINT_MAX);printf("unsigned long max = %lu\n",ULONG_MAX);return 0;}
附上运行结果
• 最后,附上速查表(不同的系统中可能不同)unsigned int : 0~4294967295
int (32位) :- 2147483648—2147483647
short int (16位):-32768~32767
unsigned long : 0~4294967295
long : -2147483648~2147483647
long long的最大值: -9223372036854775808~9223372036854775807
unsigned long long的最大值: 18446744073709551615
__int64的最大值: 9223372036854775807
__int64的最小值: