Lecture overview -- Keyboard shortcut: 'u'  Previous page: Structs -- Keyboard shortcut: 'p'  Next page: Commands and Control Structures -- Keyboard shortcut: 'n'  Lecture notes - all slides together  Annotated slide -- Keyboard shortcut: 't'  Textbook -- Keyboard shortcut: 'v'  Alphabetic index  Help page about these notes  Course home    Introduction to C# - slide 13 : 43

Operators
Most operators in C are also found in C#
Level Category Operators Associativity (binary/tertiary)
14 Primary x.y      f(x)      a[x]      x++      x--      new      typeof      checked      unchecked      default      delegate left to right
13 Unary +      -      !      ~      ++x      --x      (T)x      true      false      sizeof left to right
12 Multiplicative *      /      % left to right
11 Additive +      - left to right
10 Shift <<      >> left to right
9 Relational and Type testing <      <=      >      >=      is      as left to right
8 Equality ==      != left to right
7 Logical/bitwise and & left to right
6 Logical/bitwise xor ^ left to right
5 Logical/bitwise or | left to right
4 Conditional and && left to right
3 Conditional or || left to right
2 Null coalescing ?? left to right
1 Conditional ?: right to left
0 Assignment or Lambda expression =      *=      /=      %=      +=      -=      <<=      >>=      &=      ^=      |=      => right to left

It is possible to overload many of the C# operators

This allows for terse and convenient notation in many classes