View Single Post
Old Feb 27th, 2006, 2:33 PM   #2
Kaja Fumei
Hobbyist Programmer
 
Join Date: Oct 2005
Posts: 134
Rep Power: 4 Kaja Fumei is on a distinguished road
With unary operators, they are evaluated right to left, not left to right, so in your code, the ++ operation is done to itsSpeed before *. This causes the pointer to be incremented, rather than the value stored at the pointer's address, which is what you meant to do.

Simple fix:
++*itsSpeed;
Kaja Fumei is offline   Reply With Quote