Operators in C# 2008

Part of the C# 2008 For Dummies Cheat Sheet

In order to perform operations in C# 2008, you need, well…operators. The following chart shows you these operators. These symbols determine which operations to carry out in an expression:

Precedence Operators Cardinality Associativity
High () [] . new typeof Unary Left to right
* ! ~ + - ++ -- (cast) Unary Left to right
* * / % Binary Left to right
* + - Binary Left to right
* < <= > >= is as Binary Left to right
* == != Binary Left to right
* & Binary Left to right
* ^ Binary Left to right
* | Binary Left to right
* && Binary Left to right
* || Binary Left to right
* ?: Ternary Right to left
Low = *= /= %= += -= &= ^= |= <<= >>= Binary Right to left
  • Add a Comment
  • Print
  • Share
blog comments powered by Disqus

SERIES
C# 2008 For Dummies Cheat Sheet

Advertisement

Inside Dummies.com