Please note, that this has nothing to do with Operator Precedence.. () and ++ , Undefined behavior and sequence points , Why are these constructs using pre and post-increment undefined behavior? and the hundreds similar questions about this here
Shortly: is the Associativity guaranteed by the standard?
Detailed example: from Wikipedia's article for operator precedence, operator*
and operator/
have the same priority and they are Left-to-right
operators. Does this mean, that the standard guarantees, that this:
int res = x / y * z / t;
will be evaluated as
int res = ( ( x / y ) * z ) / t;
or it's implementation defined?
If it's guaranteed, could you quote?
It's just out of curiosity, I always write brackets in these cases.
Ready to delete the question, if there's such one.