In simple terms, && is true (1) if both sides of the expression returns NOT 0.
/* These all return TRUE (1) */ if (4 && 5) return(); i=3; j=2; return( i && j);
THIS CAN CAUSE SERIOUS PROBLEMS.
k=0; i=3; j=2; if ( i-i && j++) k=1
The left side (i-i) resolves to 0, so j is not
incremented and k is not changed.
OR also evaluates 'Left to Right' and will stop when an expression returns true.
k=0; i=3; j=2; if ( i+i && j++) k=1
What are j and k going to be when this code is
executed?????
NOT reverses the logical state of its operand. If the operand is 0, 1 is returned, else 0 is returned.
!4 /* Returns 0 */ !-4 /* Returns 0 */ !1 /* Returns 0 */ !0 /* Returns 1 */
| Top | Master Index | Keywords | Functions |