Cold Help System: Programming: ColdC Reference Manual: Language Structure: Expressions: Operators: Assignments: Dual


Dual Role Assignment operators join an arithmetic operator and the simple assignment operator into one for the purpose of simplicity and optimization. The Dual Role Assignment operators are:

+=
-=
*=
/=

These operators must have a variable as the left argument. When used, the arithmetic expression is evaluated as normal, and the result is assigned back into the variable on the left. The following examples are equivalent:

x = x + 5
x += 5

When evaluating the arithmetic expression the operator behaves the same as the equivalent Arithmetic Operator, including any Non-Arithmetic Behaviour.


Simple | Scatter | Dual | Default


the Cold Dark