The logical operators are called and , or , not , xor . Since they also act as bitwise operators, you may need to use parenthesis around some expressions, to avoid confusing the compiler.
The reason is not due to they are also use as bitwise operators (in fac, syntactically both are the same, only the semantics that are different), but due to operator precedence where they're on higher level than relational operators. Thus:
Thank you! Something was ringing in my head when writing this, that the operator precedence was the root cause, but I couldn't pinpoint it. I reworked the text around, to explain it correctly. Thanks!
The reason is not due to they are also use as bitwise operators (in fac, syntactically both are the same, only the semantics that are different), but due to operator precedence where they're on higher level than relational operators. Thus:
would be seen as:
instead of:
by the compiler