CS 3304: Comparative Languages
Arithmetic Expressions
[
Course Documents
] : [
Arithmetic Expressions
]
Previous
Contents
Next
Keyword Index
More Complicated Assignments
1. Multiple targets (PL/I)
A, B = 10
2. Conditional targets (C, C++, and Java)
(first = true) ? total : subtotal = 0
3. Compound assignment operators (C, C++, and Java)
sum += next;
4. Unary assignment operators (C, C++, and Java)
a++;
C, C++, and Java treat = as an arithmetic binary operator
a = b * (c = d * 2 + 1) + 1
This is inherited from ALGOL 68