posted 5 years ago
Hi,
I thought I was understanding post-unary increment/decrements, but apparently not.
code:
My doubt:
I'd understood from the explanation on the book on page 58 that "if the operator is placed after the operand, [...], then the original value of the expression is returned, with operator applied after the value is returned." The examples of page 59 consubstantiate this. Hence, I thought that in the first iteration while (9 > 1) m would be 9, and 8 or 7 in the second or third loop, respectively.
But I'm wrong, and 've compiled and checked for each loop the value of m to be 8, 7 and 6, respectively.
What am I not grasping about post-unary operators?