What does least significant byte mean?

后端 未结 4 1080
佛祖请我去吃肉
佛祖请我去吃肉 2020-12-09 19:43

I have to implement a method that writes a byte to an ostream object. Let\'s just called this ostream object strobj. I also have a bit

4条回答
  •  甜味超标
    2020-12-09 20:30

    The more significant bits of an int are the ones that contribute more to its value. The least significant bits contribute less. You can normally obtain these by anding the integer with 255 (a byte with all 1s)

    int lsb;
    lsb = SumInt & 255;
    

提交回复
热议问题