peternilsson42 wrote: > --- In [email protected], Arvind Balodia <arvind.balo...@...> wrote: >> As i saw the simple problem of increment and decrement >> has become an issue of debate in this group and now we >> are started to blame on each others knowledge. > > There really isn't anything being debated. There is only > ignorance being corrected. Of course, we are all here to > correct our ignorance. ;) > >> ...Consider the following statement: >> x = j * j++; >> >> The C language does not specify which multiplication >> operand is to be evaluated first. > <snip> > > True, but more importantly, it leaves undefined the behaviour > of an expression where an object value is used for a purpose > other than computing the new value of the that object.
What everyone to date has failed to point out is that the discussion is pointless if the next person who has to maintain your code doesn't understand it. Always write code such that the next person who has to maintain it is a serial killer and knows where you live. Therefore...which is less likely to get you killed: x = i * j++; OR: x = i * j; j++; -- Thomas Hruska CubicleSoft President Ph: 517-803-4197 *NEW* MyTaskFocus 1.1 Get on task. Stay on task. http://www.CubicleSoft.com/MyTaskFocus/
