Are the following two statements equivalent?
bitField = (bitField & (--bitField));
bitField = (bitField & (bitField-1));
Yes or no?
Thanks for the answers so far. Here is more information that I
should've included with the original post:
The variable bitField is of type int and on my implementation an int
is 32 bits, two's complement.
The first statement was translated from Java, where it apparently
worked exactly as the second. (I think I remember reading that Java
guarantees left-to-right execution? Don't know.)
Anyway, I looked in my K&R for sequence points and couldn't find
anything. Can someone please elaborate on sequence points? Thanks.