Logical equality in C

前端 未结 4 602
暗喜
暗喜 2021-01-17 20:07

[It seems odd this doesn\'t exist, so apologies in advance if it\'s a duplicate]

I want to test for logical equality in C. In other words, I want to know whether tw

4条回答
  •  一生所求
    2021-01-17 20:37

    There is no (bool) in traditional c. True/False is handled using ints. You can check for boolean equality with

    a ? b : !b
    

提交回复
热议问题