O'Reilly logo

C# Primer Plus by Klaus Michelsen

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Determining the Type of an Expression

Several examples were presented in the previous chapter of how the many simple types found in C# impose a complicated life for the compiler. We saw how the C# compiler attempts to handle the often tricky situations of assignment statements by performing implicit conversions, and how the programmer can interfere by using explicit conversions in the form of type casts.

In this section, we will look at how operators affect the type of the value returned from a numerical expression. This will enable you to determine the type of expressions, such as

which mixes together two types. Because any expression only has ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required