Any non-zero number or non-null pointer is considered to have a logical value of “true”, whereas a number with value 0 or a null pointer is considered to have a logical value of “false”.
The !
operator is the logical NOT operator (as opposed to a bit-wise NOT operator). It inverts the logical value of its operand, producing the integer value 0 if the operand has a logical value of “true”, and the value 1 if the operand has a logical value of “false”.
solved What is the purpose of “!” in this code from “Point in Polygon Test”? [closed]