unsigned char DoubleChar_to_UnsignedInt(char value1, char value2)
{
unsigned int tmp;
char trans_buff[3];
trans_buff[0] = value1;
trans_buff[1] = value2;
trans_buff[2] = 0;
sscanf(trans_buff, "%02X", &tmp);
return tmp;
}
unsigned char DoubleChar_to_UnsignedInt(char value1, char value2)
{
unsigned int tmp;
char trans_buff[3];
trans_buff[0] = value1;
trans_buff[1] = value2;
trans_buff[2] = 0;
sscanf(trans_buff, "%02X", &tmp);
return tmp;
}
转载于:https://www.cnblogs.com/keyhallen/p/4364999.html