A doubt about order of execution of statement

I can't figure out whether the statement will return true or false:
1
2
x = 1;
if ((x++) && (x--))

If I try it out, I get true. But I am not sure that whether the order in which the two are executed is defined or not.
So will it depend on compiler or is it defined?
&& is a sequence point and the operands are evaluated from left to right, so it's defined.
If you really want to know, switch the statement around. Now, the value of 'x' never goes below 1 (thus always true), thus the statement reduces to either "2 && 1" (if the brackets are handled first) or "1 && 1" (if brackets are ignored). Switching the statement around would either result to "1 && 1" or "0 && 1".

To be honest, I don't really see a good reason to have two increment or decrement operators on the same variable in a single statement. Even if it provides the result you want, it's definitely not going to improve readability.
@Athar:
Thanks a lot!
@Gamnic:
I am not using it anywhere at all! It was sheer curiosity...
Topic archived. No new replies allowed.