p2p.wrox.com Forums

p2p.wrox.com Forums (http://p2p.wrox.com/)
-   BOOK: Ivor Horton's Beginning Visual C++ 2005 (http://p2p.wrox.com/book-ivor-hortons-beginning-visual-c-2005-249/)
-   -   chapter 5 Ex5_01 question (http://p2p.wrox.com/book-ivor-hortons-beginning-visual-c-2005/78007-chapter-5-ex5_01-question.html)

earlmw January 29th, 2010 05:18 PM

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

earlmw January 29th, 2010 05:52 PM

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.


All times are GMT -4. The time now is 04:36 AM.

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