On Sun, Sep 14, 2008 at 15:23, Arthur Schwarz <aschwarz1309@xxxxxxxxxxx> wrote: > > I would have expected that the last result would have been not equal. What seems to be happening is either the original 'num' is being compared to itself or the pre-increment 'num' is being compared to itself. At first blush, this appears wrong. Have I misunderstood the semantics? > My understanding is that all this is fundamentally UB, since you're reading and updating values without a sequence point separating them. It's the same sort of thing as why i = i++; is UB.