Kavita
Regular
Kavita
Aqeel
Originally posted by Amit Saini:
Hi all,
i=expr;
-the value of the expr is assigned to i;
-now the assignment operator is at the last of precedence table
therefore whatever be the expression, the value of that expression will be assigned to i, as the last step of evaluation.
-now let us dissect the expression>
i=0;
i=i++;
the value of i comes out to be 0 as we all know.
this is how it all works.
++ has higher precedence.
i++ will increment the value of i but u see since it is a post increment operator the initial value of i i.e 0 is somehow magically stored in the expression..
i=(i++) as i=(0); //note i is incremented to 1
now , the final evaluation is:
i=0; // even at this moment i was 1;
but after the exec. of the above statement i becomes 0;
i hope it is clear
Kavita
Hey guys!! come and have some cups of HOT JAVA........<BR>Adeesh
Kavita
Eric Boehme, Co-Founder The Java Information Group<br /> <br />"Only those who dare to fail greatly can ever achieve greatly." Robert Francis Kennedy
We find this kind of rampant individuality very disturbing. But not this tiny ad:
a bit of art, as a gift, that will fit in a stocking
https://gardener-gift.com
|