Double_HEX(Ddata,data);for(inti=0;i<8;i++) printf("0x%X\n",data[i]);return0; } 三、十六进制(HEX) 转 浮点数 1. 十六进制(HEX) 转 单精度(float) 具体代码如下: intmain(intargc,char*argv[]) {chardata[4] = {0x5C,0x8F,0x4A,0x41};floatfdata =0; memcpy(&fdata,data,sizeof...
1、单精度(float) 转 十六进制(HEX) (1)指针法 具体代码如下: void Float_HEX (float fdata, unsigned char *hdata){unsigned char* tdata = (unsigned char*)(&fdata);hdata[0] = tdata[0];hdata[1] = tdata[1];hdata[2] = tdata[2];hdata[3] = tdata[3];} 测试用例如下: int main(...