Boolean Logical Compound Assignment Operators: &=, ^=, |= – Basic Elements, Primitive Data Types, and Operators

Boolean Logical Compound Assignment Operators: &=, ^=, |= Compound assignment operators for the boolean logical operators are defined in Table 2.27. The left-hand operand must be a boolean variable, and the right-hand operand must be a boolean expression. An identity conversion is applied implicitly on assignment. These operators can also be applied to integral operands … Read more

The Conditional Operator ?: – Basic Elements, Primitive Data Types, and Operators

2.18 The Conditional Operator ?: The ternary conditional operator ?: allows conditional expressions to be defined. The conditional expression has the following syntax: condition ?expression1 :expression2 It is called ternary because it has three operands. If the boolean expression condition is true, then expression1 is evaluated; otherwise, expression2 is evaluated. Both expression1 and expression2 must evaluate to … Read more