#include
unsigned int ExcData(unsigned int udDatIn,unsigned char ucLen )
{
char i;
unsigned int udTemp1 = 0;
unsigned int udTemp2 = 0;
for(i = ucLen - 1; i >= 0; i--)
{
udTemp1 = udDatIn & 0x01;
udTemp1 <<= i;
udTemp2 |= udTemp1;
udDatIn >>= 1;
}
return udTemp2;
}
void main()
{
printf("0xffee倒序 = 0x%x\n",ExcData(0xffee,16));
printf("0xec倒序 = 0x%x\n",ExcData(0xec,8));
}
wxg1988 2013-1-14 12:40
用户40900 2008-1-10 16:42
用户20398 2007-12-22 15:58