Wrox Programmer Forums Ex 10, Chapter 5, page 253
 |
BOOK: Ivor Horton's Beginning Visual C++ 2005
 This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2005 by Ivor Horton; ISBN: 9780764571978 Read more about Ivor Horton's Beginning Visual C++ 2005 or buy the book from your favorite retailer Download the code for Ivor Horton's Beginning Visual C++ 2005
 Welcome to the p2p.wrox.com Forums. You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2005 section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com

May 30th, 2006, 05:15 AM
 Nick Y Authorized User Join Date: May 2006 Posts: 60 Thanks: 0 Thanked 0 Times in 0 Posts
Ex 10, Chapter 5, page 253

Receiving a Variable Number of Arguments

Answers (10 and 172630728) are incorrect; they should be 42 and 473.

Count integers (6 and 9) are missing after start of brackets of 'cout' lines.

i.e.
cout<< sum(6, 2,4,6,8,10,12) <<endl;
cout<< sum(9, 11,22,33,44,55,66,77,66,99) <<endl;

(Also note, second list has 66 twice and not 88 as one might assume.)

June 16th, 2006, 01:14 AM
 mitmaro Registered User Join Date: Jun 2006 Posts: 2 Thanks: 0 Thanked 0 Times in 0 Posts

The reason for the answers in the book:
sum(2,4,6,8,10,12) - adds 4 and 6 to get 10 the other numbers are thrown out.
sum(11,22,33,44,55,66,77,66,99) - adds the 8 values supplied plus the next 3 values in memory.

::TIM::

 Similar Threads Thread Thread Starter Forum Replies Last Post Chapter 10, Try it out Page 365, C#, line 7 tbroom BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 3 June 12th, 2007 10:23 PM Errata - Chapter 10, Page 378, C# RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 August 31st, 2006 09:56 AM Errata - Chapter 10, Page 376, C# RobC BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 0 August 31st, 2006 09:07 AM Chapter 10, Try It Out error, page 380 VictorVictor BOOK: Beginning ASP.NET 2.0 BOOK VB ISBN: 978-0-7645-8850-1; C# ISBN: 978-0-470-04258-8 2 February 13th, 2006 12:41 PM