Next:
Unary Operator
Up:
Operators
Previous:
Example
Contents
Unary Operators
The unary operator performs operations on only one operand.
Table 2.4:
Unary Operators
Operator
Meaning
+
Unary plus
-
Unary minus: inverts the sign of an expression
++
Increment operator: increments value by 1
–
decrement operator: decrements value by 1
Logical complement operator: inverts the value of a boolean
Subsections
Unary Operator
Increment and Decrement Operator
Example