5606| 13
|
如何把4字节16进制数转成10进制浮点型数据 |
1金钱
最佳答案#include
typedef union{
float i;
unsigned char a[4];
}myfloat;
int main()
{
/* 我的第一个 C 程序 */
myfloat t;
t.i = 21.379417;
printf("0x%02X 0x%02X 0x%02X 0x%02X\n",t.a[0],t.a[1],t.a[2],t.a[3]);
return 0;
}
运行这个程序看看打印出来的数据就知道了
| ||
| ||
He who fights with monsters should look to it that he himself does not become a monster, when you gaze long into the abyss, the abyss also gazes into you.
过于执着就会陷入其中,迷失自己,困住自己。 |
||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
| ||
|手机版|OpenEdv-开源电子网
( 粤ICP备12000418号-1 )
GMT+8, 2025-5-29 06:29
Powered by OpenEdv-开源电子网
© 2001-2030 OpenEdv-开源电子网