Guys plz tell that postincremented variable is  incremented after sequence
or after ;

as we have && || comma and ; as sequence point

so say we have
int i=10;
int j=(i++,i++);
firstly i++ goes and as comma comes so ++ post inc. takes place and take to
11 ..now when next time the postincremented is done later after ;  and
firstly the value 11 is assigned to j

so after this statement we have j=11,i=12

but if i write
int a=0;
int j=a++&&1;
so when && comes so postincrement takes place and assign this to j...so at
the point we reach && acc. to me a=1..But a remains 0 as this expression
goes to false...can anybody tell me y so happens..when does the value in
postincremented is incremented...i am sure about comm and ;...but what in
case of && and  ||....these are also sequence point...y post increment
doesnt take place when we reach &&...please explain..

-- 
You received this message because you are subscribed to the Google Groups 
"Algorithm Geeks" group.
To post to this group, send email to algogeeks@googlegroups.com.
To unsubscribe from this group, send email to 
algogeeks+unsubscr...@googlegroups.com.
For more options, visit this group at 
http://groups.google.com/group/algogeeks?hl=en.

Reply via email to