Logical Operators in C

前端 未结 8 2046
说谎
说谎 2020-11-27 08:25

I am having trouble trying to understand how logical operators work in C. I already understand how the bit-level operators work, and I also know that logical operators treat

8条回答
  •  半阙折子戏
    2020-11-27 09:12

    && is a logical operator, not a bitwise operator. Both 0x65 and 0x55 are true, so the result is a true number. 0x01 is a true number.

    Binary representations only come into play for bitwise operations. The expression 0x65 & 0x55 is equal to 0x45.

提交回复
热议问题