What does left-to-right associativity mean?

后端 未结 6 685
生来不讨喜
生来不讨喜 2020-12-29 21:23

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

6条回答
  •  生来不讨喜
    2020-12-29 22:09

    Simplest and most non-tl;dr answer I found:

    In most programming languages, the addition, subtraction, multiplication, and division operators are left-associative, while the assignment, conditional, and exponentiation operators are right associative.

    thanks to: http://www.computerhope.com/jargon/a/assooper.htm

提交回复
热议问题