Wrox Programmer Forums

Need to download code?

View our list of code downloads.

Register | 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 Display Modes
  #1 (permalink)  
Old January 29th, 2010, 04:18 PM
Authorized User
Points: 96, Level: 1
Points: 96, Level: 1 Points: 96, Level: 1 Points: 96, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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 04:24 PM. Reason: entering warning message
  #2 (permalink)  
Old January 29th, 2010, 04:52 PM
Authorized User
Points: 96, Level: 1
Points: 96, Level: 1 Points: 96, Level: 1 Points: 96, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
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.
 


Thread Tools
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 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 17th, 2007 11:18 PM



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


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