Code:void main() { int i=10,j; j=i++*i++; printf("%d",j) } o/p 100 void main() { int i=10; printf("%d",i++*i++); } o/p 110 why this o/p difference?anyone know?help me
Code:void main() { int i=10,j; j=i++*i++; printf("%d",j) } o/p 100 void main() { int i=10; printf("%d",i++*i++); } o/p 110 why this o/p difference?anyone know?help me
You are in the realm of undefined behaviour, as you read a variable twice in an expression where you also write it.
Incidentally, you might want to read more about main().
Last edited by laserlight; 05-20-2007 at 07:35 AM.
Look up a C++ Reference and learn How To Ask Questions The Smart WayOriginally Posted by Bjarne Stroustrup (2000-10-14)
thank you laselight for your answer and good advice.