Little endian Vs Big endian

后端 未结 5 1547
北海茫月
北海茫月 2021-02-01 10:32

Lets say I have 4Byte integer and I want to cast it to 2Byte short integer. Am I right that in both (little and big endian) short integer will consist of 2 least significant by

5条回答
  •  旧巷少年郎
    2021-02-01 11:11

    1. Yes. When you convert values, you don't have to worry about endianness.

    2. Yes. When you convert pointers, you do.

提交回复
热议问题