Author response: Microsoft Visual C# 2013 Step by Step


Author response: Microsoft Visual C# 2013 Step by Step

  • Comments 5

As you might know, you can give us feedback anytime about our books via http://aka.ms/tellpress. (We know you’re busy, so we’ve kept it short with just a few questions.) But because we don’t ask for personal information, we can’t respond personally to comments and questions that you leave us. So, in case the person who left us the following follows our blog, we want you to know that we sent your comment to the book’s author. First, your comment:

9780735681835          Microsoft Visual C# 2013 Step by Step                                                                                  

Very satisfied–Definitely would recommend

I can't get the EnumeratorTest exercise in chapter 19 to compile.

An explicit interface  IEnumerator<TItem> IEnumerable<TItem>.GetEnumerator() is generated in class Tree<TItem> which is private. It then cannot be accessed by the foreach() call in EnumeratorTest. This is the situation described earlier in chapter 13 with the 'number of legs' Horse example. You seem to contradict your own earlier lesson.

And here is author John Sharp’s response:.

I suspect that the reader has made a mistake somewhere in his/her code. The foreach statement in C# hides the complexity of using an enumerator, and as long as the collection being enumerated implements the IEnumerable interface explicity (i.e., it provides an explicit implementation of GetEnumerator), then the GetEnumerator method should not be public - indeed, it cannot be public because explicit interface implementation prohibits public methods as described in Chapter 13. The key thing is that the class being enumerated must be enumerable, and the compiler handles the rest when it generates the code for the foreach statement.

Cheers

JohnS

Hope that helps!

  • Please where can i download the code samples ? the link in the book does not work and i need these or the book is useless!

  • Like Steve G, I'm trying to find where I can download the code samples.  The "download" link from http://aka.ms/VC2013SbS/files is dead.  More specifically...  \\www.microsoftpressstore.com/.../C returns "File not found".

  • Yes Rick many of us are waiting on this to be fixed. I can't find the zip file anywhere else online. I've emailed one of the MS help addresses hopefully they will fix it soon.

  • Steve G and Rick P, we'll get this fixed ASAP. We're working on this with Pearson (who hosts our store site) now. I'll post another comment when the issue is fixed. Thanks for letting us know!

  • This is fixed now.

Page 1 of 1 (5 items)
Leave a Comment
  • Please add 8 and 6 and type the answer here:
  • Post