C# Operators and Precedence

It’s not always easy to determine which C# operators take precedence over others. The following table offers a list of common C# operators and their precedence, along with their cardinality and associativity.























































































PrecedenceOperatorsCardinalityAssociativity
High() [] . new typeofUnaryLeft to right

! ~ + - ++ -- (cast) UnaryLeft to right

* / %BinaryLeft to right

+ -BinaryLeft to right

< <= > >= is asBinaryLeft to right

== !=BinaryLeft to right

&BinaryLeft to right

^BinaryLeft to right

|BinaryLeft to right

&&BinaryLeft to right

||BinaryLeft to right

?:TernaryRight to left
Low= *= /= %= += -= &= ^= |= <<=
>>=
BinaryRight to left








dummies

Source:http://www.dummies.com/how-to/content/c-operators-and-precedence.html

No comments:

Post a Comment