i = sizeof(char);//char是一字节的变量
if(i == 1)
{
led0 = 0;
}
i = sizeof(int);
if(i == 2)//led等亮,测验int是两字节的变量
{
led1 = 0;
}
i = sizeof(unsigned int);//unsigned int 是两字节的变量
if(i == 2)
{
led2 = 0;
}
i = sizeof(long);//long 是四字节的变量
if(i == 4)
{
led3 = 0;
}
i = sizeof(float);//float是四字节的变量
if(i == 4)
{
led4 = 0;
}
i = sizeof(double);//double是四字节的变量
if(i == 4)
{
led5 = 0;
}
int *pointer = 0;
int i =0;
i = sizeof(pointer);//指针的长度为3
if(4 == i)
{
led0 = 0;
}