HPlogo HP C/HP-UX Reference Manual: Workstations and Servers > Chapter 5 Expressions

Unary Operators

» 

Technical documentation

Complete book in PDF

 » Table of Contents

 » Index

You form unary expressions by combining a unary operator with a single operand. All unary operators are of equal precedence and group from right to left.

Syntax

unary-expression ::=
postfix-expression
++ unary-expression
-- unary-expression
unary-operator cast-expression
sizeof unary-expression
sizeof ( type-name )

unary-operator ::= one selected from
& * - ~ ! +

Examples

Title not available (Examples )

The unary plus operator :

+var

The unary minus operator :

-var

The address-of operator :

&var

The indirect operator :

*ptr

The logical NOT operator :

!var

The bitwise NOT operator :

~var