Decrementing operator is the complementary part of the incrementing operator. What applies to the incrementing operator, also applies for the decrementing one.
Obviously, the difference is in the syntax and behavior. Decrementing operator can be expressed in four ways, just like incrementing one:
1 |
--variable, variable--, variable -= 1, variable =- 1 |
The difference in behavior should be obvious and self-explanatory: instead of adding, we subtract.… Read more