Post and pre-increment operaor question on page 59 (Sybex)
posted 2 months ago
I am working through the post and pre-increments/decrements and I got a different result than the book is showing.
I then entered the code into Eclipse and the output also is different from the example.
Code on page 59:
int x = 3;
int y = ++x * 5 / x-- + --x;
x is 2
y is 7
My results using pencil and paper are:
x is 3
y is 9