#include <stdio.h>
main()
{unsigned long int temp;
unsigned char cool=0x0f;
temp=(cool<<7);
printf("%d",temp);
}
有一个疑问,cool是char型的数据,左移七位丢失数据(书上写的)。可是在这里,却可以不丢失数据。why?
#include <stdio.h>
main()
{unsigned long int temp;
unsigned char cool=0x0f;
temp=(cool<<7);
printf("%d",temp);
}
有一个疑问,cool是char型的数据,左移七位丢失数据(书上写的)。可是在这里,却可以不丢失数据。why?