Next: Calling Functions

Prev: Variables

Operators

Operators are used to perform simple operations on expression values, such as adding two values together. C-- provides a variety of operators to perform arithmetic and logical operations on data. Most of these operators fall into two syntactical categories: unary operators and binary operators.

Unary operators act on a single expression value. In C--, all unary operators are single characters which precede expressions. For example, !a is the logical negation of the value of the variable a.

Binary operators act on two expression values. For example, a + b is the sum of the values of the variables a and b.

Several operators are neither unary nor binary. The message operator (.) acts on a value on the left but a message name and an argument list on the right (see Sending Messages). The index operator ([]) uses two punctuation marks to delimit the beginning and end of the offset (see Lists). The conditional operator (?|) operates on three data values (see Conditional Operators).

Menu:

Precedence
Resolving ambiguous expressions
Arithmetic
Arithmetic operators
Logic
Logical and relational operators
Conditional Operators
Conditional operators