Go4Expert

Go4Expert (http://www.go4expert.com/)
-   C (http://www.go4expert.com/forums/c/)
-   -   increment operator- help me please (http://www.go4expert.com/forums/increment-operator-help-t23465/)

ajayfame 2Oct2010 19:35

increment operator- help me please
 
please help me with this.....

a=1;

b = a++ + ++a+ ++a;

the output is coming b=7...


can any1 plzz explain

jimblumberg 2Oct2010 21:35

Re: increment operator- help me please
 
This is undefined behavior.
Read Stroustrup's answer to the a++ + ++a FAQ http://www2.research.att.com/~bs/bs_...aluation-order


All times are GMT +5.5. The time now is 10:08.