如何将16进制数组转成16进制字符串?
bHi, bLo;
*pStr;
for()
{
bHi = *pSrc >> 4;
bLo = *pSrc & 0x0F;
if( bHi > 9 ) *pStr = (bHi-10) + 'a';
else *pStr = bHi + '0';
pStr++;
if( bLo > 9 ) *pStr = (bLo - 10) + 'a'l;
else *pStr = bLo + '0';
pStr++
}
或者用sprintf
j = 0;
for(i = 0; i< 10; i++)
{
j+= sprintf(tab+j, "%2x", Rec_buf[i]); //或"%x"
}
//还不行你自己百度sprintf