03.01.2015 Views

C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

Visual Studio 2013 C# 5.0 Programmer's Reference

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

5Operators<br />

What’s in This Chapter<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

➤➤<br />

Arithmetic, concatenation, comparison, logical, and bitwise<br />

operators<br />

Operator precedence<br />

DateTime and TimeSpan operators<br />

Operator overloading<br />

Type conversion operators<br />

Wrox.com Downloads for This Chapter<br />

Please note that all the code examples for this chapter are available as a part of this chapter’s<br />

code download on the book’s website at www.wrox.com/go/csharp5programmersref on the<br />

Download Code tab.<br />

An operator is a basic code element that performs some operation on one or more values to create<br />

a result. The values the operator acts upon are operands. For example, in the following statement,<br />

the operator is + (addition), the operands are B and C, and the result is assigned to the variable A.<br />

A = B + C<br />

<strong>C#</strong> operators fall into five categories: arithmetic, concatenation, comparison, logical, and bitwise.<br />

This chapter first explains these categories and the operators they contain; it then discusses other<br />

operator issues such as precedence, assignment operators, and operator overloading.<br />

www.it-ebooks.info

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!