The ++
will do an increment of b
, a memory address, after evaluation in the context of the larger expression.
From http://msdn.microsoft.com/en-us/library/e1e3921c.aspx:
It is important to note that a postfix increment or decrement expression evaluates to the value of the expression prior to application of the respective operator. The increment or decrement operation occurs after the operand is evaluated. This issue arises only when the postfix increment or decrement operation occurs in the context of a larger expression.
So, what happens is that you apply a post-fix increment to b
, but the dereference *
is given the original value of b
, which points to 10
. If you were to print out b
or *b
you'll see that the value and address have changed to something unexpected.