Summary

This chapter covered the various C# operators—unary, arithmetic, relational operators, and other operators—and provided examples of how to use them.

The unary operators include plus, minus, increment, decrement, logical complement, and bitwise complement operators. Binary operators include the arithmetic, logical, relational and assignment operators. There is a single ternary operator that produces conditional results. C# has a few other operators that don't fit into the any of those categories; they include the is, as, typeof, sizeof, checked, and unchecked operators.

The enum and array types have additional functions that make programs more expressive and powerful. I included several examples of enums and a table of array methods and ...

Get C# Unleashed 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.