When I try the following code:
#if 11 & 10 == 10
#endif
the evaluation of expression is true but when I change that to the following:
#if 10 & 10 == 10
#endif
The evaluation returns false, while based on definition of & operator it should still return true (when I am trying out of preprocessor that's correct). Generally, Whatever I am trying which has 0 in the first operand returns false ignoring what the result is.
Does anyone know what the problem is?
Order of operation seems to be the culprit since ==
is evaluated before &
. Parentheses worked for me:
#if (10 & 10) == 10
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With