Possible Duplicate:
Undefined Behavior and Sequence Points
the output of the programme
#include<stdio.h>
main()
{
int i = 10;
printf("%d %d %d\n", ++i, i++, ++i);
}
is 13 11 13. Can someone please explain this ?
Possible Duplicate:
Undefined Behavior and Sequence Points
the output of the programme
#include<stdio.h>
main()
{
int i = 10;
printf("%d %d %d\n", ++i, i++, ++i);
}
is 13 11 13. Can someone please explain this ?
It's the oldest question ever. Why do people find this so fascinating?
This is undefined behavior; you're relying on side-effects without a sequence point between modifications.