C# in Depth

Cover of C# in Depth
Order now (3rd edition)

(You are currently looking at the first edition version of this page. This page is also available for the second and third editions.)

Errata for Chapter 4: Saying nothing with nullable types

P124, bottom paragraph: Accidental reversal of int and long in example

In the commentary on lifted conversions with nullable types, I use int and long as the examples for the S and T types in the specification. Unfortunately, in one place I got them the wrong way round. This sentence:

To carry our example forward, this means that you can convert implicitly from int? to long? and from int to long? as well as explicitly from long? to int.

should read

To carry our example forward, this means that you can convert implicitly from int? to long? and from int to long? as well as explicitly from int? to long.

(note the change in the last few words). In fact, it's still correct - there is an explicit conversion from long? to int, but only because of the explicit conversion from long to int.

P131, end of intro to 4.4: Incorrect cross-reference

The introductory paragraph to section 4.4 (in the middle of the page) ends with a reference to section 3.2.6. Unfortunately, there is no such section - although if you keep counting from 3.2.3 to 3.3.1 you'll see some of the history of the book...

The correct reference should be to 3.3.3 and in particular the note in the middle of page 81.