How to write endian agnostic C/C++ code?

前端 未结 7 818
我在风中等你
我在风中等你 2020-12-08 00:40

I did some googling and couldn\'t find any good article on this question. What should I watch out for when implementing an app that I want to be endian-agnostic?

相关标签:
7条回答
  • 2020-12-08 01:24

    Inside your code you can pretty much ignore it - everything cancels out.

    When you read/write data to disk or the network use htons

    0 讨论(0)
提交回复
热议问题