C++ logical operators and logical expressions

The result type of the logical expression is bool, and the value can only be true or false.

  • "!" is a unary operator, and the usage form is:! Operand. The function of non-operation is to negate the operand.
  • "&&" is a binary operator. The function of "&&" operation is to find the logical AND of two operands
  • "||" is also a binary operator. The function of "||" operation is to find the logical OR of two operands.

Guess you like

Origin blog.csdn.net/weixin_55323026/article/details/114963350