Rule or Rules of evaluation in C++

hi. Is there any Rule or Are there any Rules of evaluation in C++ ?

This will help me code with in depth understanding contrast to hastily coding and try/debug worthless style
Last edited on
Yes, we call them operator precedence.
http://en.cppreference.com/w/cpp/language/operator_precedence
Rules of precedence are http://en.cppreference.com/w/cpp/language/operator_precedence
Rules of evaluation are http://en.cppreference.com/w/cpp/language/eval_order
They are different things
Hi,

I read the articles above, but am sure there is another rule (maybe I didn't read it correctly?) about evaluations of logical operator expressions:

c = a && b;

if a evaluates to false, b is not evaluated at all, because the whole thing must now be false. This is important if b is a long and complex sub expression.

I think this is somewhere in C Programming by K&R.

This post could be seen as being rather obvious & pedantic, but it might be helpful to someone :+)
That's called short-circuit evaluation and I believe it is part of the standard.
thanks
Topic archived. No new replies allowed.