Converting float values from big endian to little endian

前端 未结 9 1856
清歌不尽
清歌不尽 2020-11-30 02:40

Is it possible to convert floats from big to little endian? I have a big endian value from a PowerPC platform that I am sendING via TCP to a Windows process (li

9条回答
  •  孤街浪徒
    2020-11-30 03:26

    Don't memcpy the data directly into a float type. Keep it as char data, swap the bytes and then treat it as a float.

提交回复
热议问题