CHAPTER 4Operators

C# provides an extensive set of operators that give the programmer detailed control over the construction and evaluation of expressions. Most of C#’s operators fall into the following categories: arithmetic, bitwise, relational, and logical. These operators are examined in this chapter. Also discussed are the assignment operator and the ? operator. C# also defines several other operators that handle specialized situations, such as array indexing, member access, and the lambda operator. These special operators are examined later in this book, when the features to which they apply are described.

Arithmetic Operators

C# defines the following arithmetic operators:

The operators +, –, *, and / all work in the expected way. These ...

Get C# 4.0 The Complete Reference now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.