User`s manual

Dynamic C Users Manual digi.com 239
13.5 Equality Operators
Equal. This binary (relational) operator yields a Boolean value. The result is 1 if the left operand equals the
right operand, and 0 otherwise.
if( i == j ){
body // executes if i = j
}
OK = a == b; // true when a = b
Note that the
== operator is not the same as the assignment operator (=). A common mistake is to write
if( i = j ){
body
}
Here, i gets the value of j, and the if condition is true when i is non-zero, not when i equals j.
Not equal. This binary (relational) operator yields a Boolean value. The result is 1 if the left operand is not
equal to the right operand, and 0 otherwise.
if( i != j ){
body // executes if i != j
}
OK = a != b; // true when a != b
13.6 Logical Operators
Logical AND. This is a binary operator that performs the Boolean AND of two values. If either operand is
0, the result is 0 (FALSE). Otherwise, the result is 1 (TRUE).
Logical OR. This is a binary operator that performs the Boolean OR of two values. If either operand is
non-zero, the result is 1 (TRUE). Otherwise, the result is 0 (FALSE).
==
!=
&&
||