rondino rondino - 1 year ago 56
C Question

order of evaluation of comparison operator?

I have learnt that logical operator are guaranteed that their evaluation are from left-to right but I was wondering what are the order of evaluation of comparison operator. For instance

expression1 < expression2
in other words is it guaranteed that
will be first evaluated before

Answer Source

According to the standard:

J.1 Unspecified behavior

The following are unspecified:

— The order in which subexpressions are evaluated and the order in which side effects take place, except as specified for the function-call (), &&, ||, ?:, and comma operators (6.5).

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download