Every expression in C or C++ has a type, a value, and possible side-effects.
int i;
++i;
The type of ++i
is int
. The side-effect is to increment i
. The value of the expression is the new value of i
.
int i;
i++;
The type of i++
is int
. The side-effect is to increment i
. The value of the expression is the old value of i
.