How do I convert between big-endian and little-endian values in C++?

前端 未结 30 2925
难免孤独
难免孤独 2020-11-21 23:18

How do I convert between big-endian and little-endian values in C++?

EDIT: For clarity, I have to translate binary data (double-precision floating point values and 3

30条回答
  •  春和景丽
    2020-11-21 23:52

    If you're doing this to transfer data between different platforms look at the ntoh and hton functions.

提交回复
热议问题