x=x + 10 can be represented as x+=10, It is called short hands in C++. It is faster.
This is used with all the arithmetic operators as follows.
Arithmetic Assignment Expression |
Equivalent Arithmetic Expression |
x+ = 10 |
x = x+ = 10 |
x- = 10 |
x = x- = 10 |
x* = 10 |
x = x* = 10 |
x/ = 10 |
x = x/ = 10 |
x% = 10 |
x = x% = 10 |