Can anyone explain why output of following program excerpt gives value '6' for x ?
int x=8;
x-=--x-x--;//how this statement will be processed
printf("%d",x);
Can anyone explain why output of following program excerpt gives value '6' for x ?
int x=8;
x-=--x-x--;//how this statement will be processed
printf("%d",x);
Because the behaviour is undefined as x is modified more than once between consecutive sequence points.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)