The answer he mentioned might beby mistake he typed wrong...

Really? That's your excuse for advocating undefined behavior?

I have worked it out in over different platforms and machines and this is what i m getiing as an answer.....

You have you worked it out on every compiler and platform? Because I can prove conclusively that the C standard says it's undefined behavior and that undefined behavior may cause unpredictable results. If you need proof before admitting that programming against a standard is a good idea and ignoring the warnings of said standard is a bad idea, then I'd question your competency.

You're clearly too stubborn to see reason, so let's simply agree to disagree and let readers of the thread decide for themselves which makes more sense.


Since you won't explain in why the link I posted is in error, I must assume it's correct, therefore Narue and I are correct, any you haven't learned enough C yet to know why you are not correct.

This question has already been answered. Start a new discussion instead.
Have something to contribute to this discussion? Please be thoughtful, detailed and courteous, and be sure to adhere to our posting rules.