S
Sac
Hello C Gurus,
As per my understanding given a C expression higher
precedence operators are evaluated first.
For example X=Y*3+Z*3;
As * has higher precedence Y*3 and Z*3 gets evaluated 1st
followed by +.
However when I tried the following example
++x || ++y && ++z;
Y and Z never got incremented.
As ++ operator is of higher precedence I think all
variables should be incremented first followed by || operator.
Please let me know if there are other rules in C while
evaluating an expression other than precedence and associativity.
Thanks
Sachin
As per my understanding given a C expression higher
precedence operators are evaluated first.
For example X=Y*3+Z*3;
As * has higher precedence Y*3 and Z*3 gets evaluated 1st
followed by +.
However when I tried the following example
++x || ++y && ++z;
Y and Z never got incremented.
As ++ operator is of higher precedence I think all
variables should be incremented first followed by || operator.
Please let me know if there are other rules in C while
evaluating an expression other than precedence and associativity.
Thanks
Sachin