I am confused about the definition of left-to-right and right-to-left associativity. I have also seen them called left associativity and right associativity and would like t
Left to right associativity of a operator means right side of operator should not have any operator of higher precedece(priority), but it can be of same priority. If there is any operator of higher priority on right side of our operator, then we have to solve it first.example:
x = 2 + 3 * 3;
Here, for + operator(left to right associativity), right side contains a operator * , which is of higher priority than + operator, so we have to solve it first.
x = 2 + 9;
x = 11;