S
subramanian100in
Stroustrup in his book "The C++ Programming Language - Third Edition
(NOT the special third edition)", mentions the following in page 125
in section "6.2.5 Increment and Decrement".
"By definition, ++lvalue means lvalue += 1, which again means lvalue =
lvalue + 1 provided lvalue has no side-effects".
Here I am unable to understand why Stroustrup has mentioned "provided
lvalue has no side-effects". Isn't the expression ++lvalue the same as
lvalue = lvalue + 1 always ? Kindly clarify with an example.
Thanks
V.Subramanian
(NOT the special third edition)", mentions the following in page 125
in section "6.2.5 Increment and Decrement".
"By definition, ++lvalue means lvalue += 1, which again means lvalue =
lvalue + 1 provided lvalue has no side-effects".
Here I am unable to understand why Stroustrup has mentioned "provided
lvalue has no side-effects". Isn't the expression ++lvalue the same as
lvalue = lvalue + 1 always ? Kindly clarify with an example.
Thanks
V.Subramanian