Errata

C# in a Nutshell

Errata for C# in a Nutshell

Submit your own errata for this product.

The errata list is a list of errors and their corrections that were found after the product was released.

The following errata were submitted by our customers and have not yet been approved or disproved by the author or editor. They solely represent the opinion of the customer.

Color Key: Serious technical mistake Minor technical mistake Language or formatting error Typo Question Note Update

Version Location Description Submitted by Date submitted
Printed Page 67
code sample for iterating over enum values

Enum.GetValues(typeof(Toggle)) returns a System.Array, which cannot be implicitly
cast to an object[]. I had to cast the return value first. Either that, or use the
System.Array object and iterate over it using an IEnumerator.

Anonymous   
Printed Page 113
Lines 16-19

In the regular expression under "Detecting IP addresses",
the line
@"([01]?dd|2[0-4]d|25[0-5])."
is missing a "?" right before "|2[0-4]"
So, the line should look like this:
@"([01]?dd?|2[0-4]d|25[0-5])."
This incorrect string is repeated three more times in the next three lines.

Anonymous   
Printed Page 118
second code example

IEnumerable.GetEnumerator(){
return this.GetEnumerator;
}

The call this.GetEnumerator is missing parenthesis, it should be
this.GetEnumerator();

Anonymous   
Printed Page 159
Person class declaration near the top of the page

Person implements "ISerialization". Isn't this supposed to be "ISerializable" as in
the previous page (158)?

169) 4th paragraph from the end: Retriving a Type Directly;
The example listed for Type.GetType("MyNamespace.MyType , MyAssembly); is inaccurate.
There is no signature for that pram and it is missing a quote.

Anonymous