7 More Operators
7 More Operators
In this chapter we'll meet some (though still not all) of C's more advanced arithmetic
operators. The ones we'll meet here have to do with making common patterns of
operations easier.
i = i + 1
Such an assignment is perfectly common and acceptable, but it has a few slight problems:
is a bit of a mess, and you may have to look closely to see that the similar-looking
expression
a[i+j+2*k] = a[i+j+2+k] + 1
In fact, C provides not one but two other, simpler ways of incrementing variables and
performing other similar operations.
7.1 Assignment Operators
7.2 Increment and Decrement Operators
7.3 Order of Evaluation