當前位置:編程學習大全網 - 電腦編程 - C語言中如何 取出 浮點型數據 的字節格式 ? 如 : -12.5 在內存中占用4個字節,其字節格式為 0xC1480000

C語言中如何 取出 浮點型數據 的字節格式 ? 如 : -12.5 在內存中占用4個字節,其字節格式為 0xC1480000

#include?<stdio.h>

int?main(void){

float?x;

printf("Input?x(R:?Input?error?is?over)...\n");

while(scanf("%f",&x)==1)

printf("%f?<-->?0x%08X\n",x,*(unsigned?*)&x);

return?0;

}

  • 上一篇:如何在電腦桌面上創建程序快捷方式
  • 下一篇:江寧東方出租車起步價
  • copyright 2024編程學習大全網