Yes you are right, but diffrent compiler may behave in diffrent way.
in short it is compiler dependent.
Or a different version of the same compiler, or the same compiler with
different options, or the same compiler with the same options but
something different in the source code which is apparently completely
unrelated (yes, I have seen apparently unrelated code have effects on
the code of interest, that's the fun thing with optimisers). In short,
the OP was correct ONLY for the specific run that the OP did where that
was the observed result, in general (even with the same compiler etc)
the OP is WRONG, because the only thing that can be said with certainty
is that it invokes undefined behaviour.
By the way, since the OP has been around for a long time off and on yet
is asking the question I think it is either a troll or fundamentally
incapable of learning to program in C. The meaning of undefined
behaviour was even explained to the OP back in 2005
http://groups.google.co.uk/group/co...6ce4?lnk=st&q=&rnum=33&hl=en#c54158409a166ce4