Bytes to Binary in C

后端 未结 6 732
情书的邮戳
情书的邮戳 2021-02-04 14:22

I\'m trying to simply convert a byte received from fget into binary.

I know the value of the first byte was 49 based on printing the value. I now need to convert this in

6条回答
  •  梦如初夏
    2021-02-04 15:23

    This addition in place of that will work:

    bits[i]= byte & (mask << i); 
    bits[i] >>=i;
    

提交回复
热议问题