On Mon, 21 Jan 2008 14:50:43 +0800,
friendfish <fr********@gmail.comwrote:
>
>what is the effect of fllowing code n values of a and b
b = 0;
a = 1;
b = a++ + a++;
That is "(b= (a++)+(a++))", after that b=2 and a=3;
Neither the C standard or the FAQ agree with you.
Maybe on your particular compiler it works like that, but you have no
guarantee that it will work like that anywhere else.
See another post in this same thread for a reference to the C FAQ that
explains why you should not do this.
Martien
--
|
Martien Verbruggen | Louis Pasteur's theory of germs is ridiculous
| fiction -- Pierre Pachet, Professor of
| Physiology at Toulouse, 1872