Using the C# Operators

C# has the standard set of operators to manipulate your data, and you can see the C# operators arranged by category in Table 1.7. Operators work on operands and yield a value. For example, in the expression 5 + 3, 5 is the first operand, + is the operator, 3 is the second operand, and this expression yields a value of 8. Just about all these operators are the same as in other languages, with some exceptions that we'll be seeing throughout the book.

OVERLOADING OPERATORS

As in C++, nearly all of the C# operators can be overloaded—that is, redefined for your own user-defined data types. More on this in Chapter 3.

FOR C++ PROGRAMMERS

Note that C# supports more operators than C++, such as is and typeof.

Table 1.7. The C# ...

Get Microsoft® Visual C#® .NET 2003 Kick Start 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.