not, ! (C++)

From RAD Studio
Jump to: navigation, search

Go Up to Keywords, Alphabetical Listing Index


Category

Alternative Representations of Tokens (C++), Operators (C++)

Syntax

Description

The not operator is an alternative representation of the !operator (logical negation).

not returns true if its operand is false, and false if its operand is true.

If an integer is 1, the expression of !1 indicates that the number is other than 1. not can also be used for strings as well. The expression !Smith indicates that the person's name is other than Smith.. not inverts the bits of the expression.

In order to use the not operator, you need to check the Enable new operator names option (the -VM compiler switch, available on the Compatibility page of the Project > Options dialog box).