Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Go Back   Wrox Programmer Forums > C# and C > C# 4.0 aka C# 2010 > BOOK: Beginning Visual C# 2010
Password Reminder
| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
BOOK: Beginning Visual C# 2010
This is the forum to discuss the Wrox book Beginning Visual C# 2010 by Karli Watson, Christian Nagel, Jacob Hammer Pedersen, Jon D. Reid, Morgan Skinner, ; ISBN: 9780470502266
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Beginning Visual C# 2010 section of the Wrox Programmer to Programmer discussions. This is a community of tens of thousands of software programmers and website developers including Wrox book authors and readers. As a guest, you can read any forum posting. By joining today you can post your own programming questions, respond to other developers’ questions, and eliminate the ads that are displayed to guests. Registration is fast, simple and absolutely free .
DRM-free e-books 300x50
Thread Tools Search this Thread Display Modes
  #1 (permalink)  
Old September 28th, 2010, 01:29 PM
Registered User
Join Date: Sep 2010
Posts: 10
Thanks: 0
Thanked 0 Times in 0 Posts
Default Chapter 11 semantic error pg 295

In their try it out on page 295 they have a program that goes through primes and in the constructor they have

public Primes(long minimum, long maximum)
if (min < 2)
min = 2;
min = minimum;

what this does is it always puts min at the value of 2 no matter how you instance the class because if(min < 2) . At that point in the program mins value is always the same so it will always be less than 2. The watch window says it's value is at 0.... so even if you call the program with 200 minimum it will still display primes starting from 2.

It should be
if (minimum < 2)

Thread Tools Search this Thread
Search this Thread:

Advanced Search
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Trackbacks are Off
Pingbacks are On
Refbacks are Off

Similar Threads
Thread Thread Starter Forum Replies Last Post
Error in Chapter 11 JGPatrick BOOK: Access 2007 VBA Programmer's Reference ISBN: 978-0-470-04703-3 1 January 17th, 2010 04:49 PM
Filtering Data with a Selectbox (Chapter 7 P.295) ralphbethke BOOK: Professional ASP.NET MVC 1.0 ISBN: 978-0-470-38461-9 0 September 16th, 2009 10:08 AM
Chapter 5 pg 156-7 error in book? ericfields6483 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 April 16th, 2009 04:18 PM
Chapter 11 Pg 334 Running Balance JackalBW BOOK: Access 2003 VBA Programmer's Reference 0 November 29th, 2007 04:07 AM
Beginning ASP.NET 2.0 with C# - Chapter09 pg 295 tbroom BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 1 September 1st, 2006 02:35 PM

All times are GMT -4. The time now is 06:15 PM.

Powered by vBulletin®
Copyright ©2000 - 2019, Jelsoft Enterprises Ltd.
© 2013 John Wiley & Sons, Inc.