Wrox Programmer Forums
|
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 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
 
Old January 29th, 2010, 05:18 PM
Authorized User
 
Join Date: Jan 2010
Posts: 19
Thanks: 0
Thanked 2 Times in 2 Posts
Default chapter 5 Ex5_01 question

In Chapter five the 'Try it out' example. When I entered the code for the example and ran it, it produced the same results as in the book on page 237 but it also gave me two warnings on the line 'x = power(x, power(2.0, 2.0));
When I changed it to 'x = power(x, power(2.0, 2)) it compiled without warnings.
Could it have been a mistake in the book?
The warning was C4244 : 'argument' conversion from 'double' to 'int' possible loss of data

Last edited by earlmw; January 29th, 2010 at 05:24 PM.. Reason: entering warning message
 
Old January 29th, 2010, 05:52 PM
Authorized User
 
Join Date: Jan 2010
Posts: 19
Thanks: 0
Thanked 2 Times in 2 Posts
Default

After further reading, I find the author intended it to be the first way although he said it would produce compiler warnings and would be much better to enter as I did in the second example.





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 5 Question jltscaa BOOK: Beginning Microsoft Visual Basic 2008 ISBN: 978-0-470-19134-7 6 May 18th, 2010 08:39 PM
Chapter 5 Question 5 Will BOOK: Beginning Microsoft Visual C# 2008 ISBN: 978-0-470-19135-4 1 October 24th, 2009 09:18 AM
Question on Chapter 5 arholly BOOK: Expert Access 2007 Programming ISBN 978-0-470-17402-9 1 September 2nd, 2008 04:07 PM
Chapter 4 question davidle1234 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 2 January 18th, 2007 12:18 AM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.