将二进制串转换成16进制串 void BinToHex(char *bin,char *hex) { int d=0; while(*bin)d=d*2+*bin++-'0'; sprintf(hex,"%X",d); }