May 2002
Beginner
320 pages
6h 18m
English
Let's look in a little more detail at line 19 of Tape().
The most common value to add (or subtract) and then reassign into a variable is 1. In C++, increasing a value by 1 is called incrementing, and decreasing by 1 is called decrementing.
The increment operator (++) increases the value of its variable by 1, and the decrement operator (--) decreases it by 1. Thus, if you had a variable, x, and you wanted to increment it, you would use this statement:
x++; // Start with x and increment it.
Both the increment operator and the decrement operator come in two styles: prefix and postfix.
![]() | Prefix The operator is written ... |
Read now
Unlock full access