C shorthand
Increment and decrement can be written in shorthand
Also applies to other arithmetic operators
Prefix vx. postfix
left hand: y=11
right hand: y=10;
Long Short
x=x+1 x++
x=x-1 x--
x=x+10 x+=10
x=x/3 x/=3;
x=x*3 x*/3;
x=10; x=10;
y=++x; y=x++;
Previous slide
Next slide
Back to first slide
View graphic version