void BinToHex(char *bin,char *hex) { int d=0; while(*bin)d=d*2+*bin++-'0'; sprintf(hex,"%X",d); } 转载于:https://www.cnblogs.com/dzqdzq/p/3165324.html