Boolean conversions
- Boolean to integer
-
If
the Boolean value is 0, the result is an int with a value of 0.
If the Boolean value is 1, the result is an int with a value of
1.
If the Boolean value is false, the result is
an int with a value of 0. If the Boolean value is true,
the result is an int with a value of 1.
- Scalar to Boolean
-
If
the scalar value is equal to 0, the Boolean value is 0; otherwise the Boolean
value is 1.
A zero, null pointer, or null member pointer value is converted
to false. All other values are converted to true.