Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Calendar | Search | Today's Posts | Mark Forums Read
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
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 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 May 30th, 2006, 05:15 AM
Authorized User
 
Join Date: May 2006
Location: Iver, Bucks., United Kingdom.
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default 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.)

  #2 (permalink)  
Old June 16th, 2006, 01:14 AM
Registered User
 
Join Date: Jun 2006
Location: Glovertown, Newfoundland, Canada.
Posts: 2
Thanks: 0
Thanked 0 Times in 0 Posts
Default

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::
 


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
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



All times are GMT -4. The time now is 01:58 AM.


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