81

我是怎么处理大小端及网络字节序的? | 后台服务开发

 6 years ago
source link: http://servercoder.com/2018/01/03/byte-order/?
Go to the source link to view the article. You can view the picture content, updated content and better typesetting reading experience. If the link is broken, please click the button below to view the snapshot at that time.
背景最开始接触c语言时,总会花很多精力去记各种操作符的优先级。后来才发现,实际开发根本就不用记。自此这么多年,除了加减乘除这种小学生都知道的优先级,我基本都是用括号搞定优先级。 同样,不同语言的字节序都不尽相同,比如c++大部分平台是小端存储的(c++的字节序与处理器有关系,具体大小端与编译器对应关系见参考文档1),java就是采用大端存储,c#似乎是小端存储(c#我写的少,有心人可以帮忙确认下)

About Joyk


Aggregate valuable and interesting links.
Joyk means Joy of geeK