Welcome to the lecture on increment and decrement operators in C++. We'll cover the following topics:
++x
(increment), --x
(decrement)val
initialized to 4.++val
results in 5 (increment happens first).--val
on updated val
results in 4.x++
(increment), x--
(decrement)val
initialized to 4.val++
returns 4, but val
becomes 5.val--
returns 5, but val
becomes 4.=
) assigns and returns the value.++x
) updates and then returns the value.++val + val
).Thank you for attending the lecture. See you in the next one!