Tag: asciiencoding

c中的hex到ASCII

这是我的逻辑,在C中将HEX转换为ASCII转换: for (i=0;i> 4; /*bit-shift the result to the right by four bits (ie quickly divides by 16)*/ if (char1 >9) { char1 = char1 – 0xa; char1 = char1 + ‘A’; } else char1 = char1 + ‘0’; Loc[j]=char1; j++; /*means use a bitwise AND to take the bottom four bits from the byte, […]