x++ != (x+=1)-1

Alan Mycroft am at cl.cam.ac.uk
Tue Mar 1 20:59:40 AEST 1988


In article <4030 at megaron.arizona.edu> mike at arizona.edu (Mike Coffin) writes:
>A simple way to understand the postincrement operator is to note that
>(x++) is equivalent to ((x += 1) - 1).

Not if x is a floating type.
Probably also not if x is a signed integral type and has a 'sticky'
overflow value (but then the program is undefined anyway).



More information about the Comp.lang.c mailing list