HP C/iX Reference Manual (31506-90011)
28 Chapter2
Lexical Elements
Operators
Operators
An operator specifies an operation to be performed on one or more operands.
Syntax
operator
:= One selected from the set
Description
Operator representations may require one, two, or three characters. The compiler matches
the longest sequence to find tokens. For example,
is parsed as if it had been written
which results in a syntax error. An alternate parse
is not chosen because it does not follow the longest first rule, even though it results in a
syntactically correct expression. As a result, white space is often important in writing
expressions that use complex operators. The precedence of operators is discussed in more
detail in Chapter 5.
The obsolete form of the assignment operators (=* instead of *=) is not supported. If this
form is used, the compiler parses it as two tokens (= and *).
The operators [ ], ?:, and ( ) (function call operator) occur only in pairs, possibly
separated by expressions. You can use some operators as either binary operators or unary
operators. Often the meaning of the binary operator is much different from the meaning of
the unary operator. For example, binary multiply and unary indirection:
a * b versus *p