Logical Operators and Values
Purpose | Operator example |
---|---|
false value | 0 |
true value | non-zero |
logical negation | !x |
logical and | x && y |
logical inclusive or | x || y |
int i, j; /* some code setting i and j */ if ( i = j ) { /* some stuff */ }this sets i = j and then does some stuff if j is non-zero