Thursday, October 18, 2018 20:26

Decrementing operator

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:

The difference in behavior should be obvious and self-explanatory: instead of adding, we subtract.

As for the incrementing operator, you should also be careful what kind of decrementing operator you are using (prefix or postfix).

Comments

comments

Tags: ,

Leave a Reply