浮点(FLOAT)转换为CHAR

  float wTemp=3.3;
   char sBuf[4];
   char* temp;
   memset(sBuf,0,sizeof(sBuf));
   temp=(char*)(&wTemp);
   sBuf[0] = temp[0] ;
   sBuf[1] = temp[1];
   sBuf[2] = temp[2];
   sBuf[3] = temp[3]; 

CHAR转换为浮点(FLOAT)

  char sBuf[4];
  sBuf[0]=0x33;
  sBuf[1]=0x33;
  sBuf[2]=0x53;
  sBuf[3]=0x40;
  float *w=(float*)(&sBuf);

 

Trackback: http://blog.csdn.net/sijigang/article/details/1546117 

http://blog.csdn.net/liangwei88624/article/details/6885803 

相关文章:

  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-01-07
  • 2021-07-29
  • 2022-12-23
猜你喜欢
  • 2021-12-02
  • 2022-01-11
  • 2021-12-02
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
  • 2022-12-23
相关资源
相似解决方案