EXPLORATION 11

image

Increment and Decrement

The previous Exploration introduced the increment (++) operator to advance an iterator. This operator works on numeric types as well. Not surprisingly, it has a decrement counterpart: --. This Exploration takes a  closer look at these operators, which appear so often, they are part of the language name.

image Note  I know that you C, Java, etc. programmers have been waiting for this Exploration ever since I wrote i = i + 1 in Exploration 7. As you saw in the previous Exploration, the ++ operator means more in ...

Get Exploring C++ 11, Second Edition now with O’Reilly online learning.

O’Reilly members experience live online training, plus books, videos, and digital content from 200+ publishers.