December 2004
Intermediate to advanced
1008 pages
21h 40m
English
C# provides several operators for arithmetic, logical, increment, decrement, and other operations. C# also provides for shorthand notations for common situations such as adding an amount to a variable. In addition, most of the C# operators can be overloaded by the developer. Overloading enables the developer to specify the behavior for the operator when applied to a specific type. Overloading will be covered later in this chapter. Table 3.1 provides a listing of all operators for C#.
| Category | Operator | Description | Can Overload? |
|---|---|---|---|
| Arithmetic | + | Addition | Yes |
| - | Subtraction | Yes | |
| * | Multiplication | Yes | |
| / | Division | Yes | |
| % | Modulus remainder | Yes | |
| Logical | & | Bitwise AND | Yes |
| | | Bitwise OR | Yes | |
| ^ | Bitwise exclusive OR | Yes | |
| ! | Logical negation | Yes | |
| ~ | Bitwise ... |
Read now
Unlock full access