摘要:
View Code 1boolBCDtoStr(char*str,unsignedchar*BCD,intBCD_length)2{3if(BCD==0||BCD_length==0)4returnfalse;5inti,j;6for(i=0,j=0;i<BCD_length;i++,j+=2)7{8str[j]=(BCD[i]>>4)>9?(BCD[i]>>4)-10+'A':(BCD[i]>>4)+'0';9str[j+1]=(BCD[i]&0x0F)>9?(BCD[i]&0x0F)-10 阅读全文