1.数据类型的
#include<stdio.h>
void main()
{
printf("char=%d",sizeof(char));
printf("\nshort=%d", sizeof(short));
printf("\nint=%d",sizeof(int));
printf("\nfloat=%d", sizeof(float));
printf("\ndouble=%d", sizeof(double));
getchar();
}
2.short类型
<pre name="code" class="cpp"><pre name="code" class="cpp">#include<stdio.h>
#include<limits.h>
void main()
{
short num = 100;
printf("我的智商是%o",num);
printf("\nshort的极大值是%d\nshort的极小值是%d", SHRT_MAX, SHRT_MIN);
printf("\n无符号short的极大值是%d\n无符号short的极小值是%d",USHRT_MAX,0);
printf("\nshort size=%d,unsigned short=%d", sizeof(short),sizeof(unsigned short));
getchar();
}
3.有无符号
<pre name="code" class="cpp">#include<stdio.h>
#include<limits.h>
void main()
{
unsigned short num = 65535+1;
printf("我的兜里有%d的钱",num);
getchar();
}