Logical NOT Operator (!)

The result of the logical NOT operator (!) is 0 if its operand evaluates to a nonzero value; the result is 1 only if the operand is equal to 0. The operand must be of arithmetic or pointer type. The result is of type int.

For an expression e, the unary expression !e is equivalent to the expression
(e == 0), except where overloaded operators are involved.

The following example illustrates the logical NOT operator (!):

if( !(x < y) )

If x is greater than or equal to y, the result of the expression is 1 (true). If x is less than y, the result is 0 (false).

Unary arithmetic operations on pointers are illegal.