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 July 10th, 2006, 05:37 AM
Authorized User
 
Join Date: May 2006
Posts: 60
Thanks: 0
Thanked 0 Times in 0 Posts
Default EX9_21.cpp, page 553

I am not sure, at present, whether this is a typo with a fortunate outcome or not.
The text has the following and I am querying the use of Container^ in the last of the quoted lines:

Console::WriteLine(L"Popping the items off the stack presents them in reverse order:");
Box^ item;
while((item = stack->Pop()) != nullptr)
safe_cast<Container^>(item)->ShowVolume();


Or should it be as follows?

Console::WriteLine(L"Popping the items off the stack presents them in reverse order:");
Box^ item;
while((item = stack->Pop()) != nullptr)
safe_cast<Box^>(item)->ShowVolume();


Both versions give the same answer, but I do not feel that that would always be true.








Similar Threads
Thread Thread Starter Forum Replies Last Post
Ex6_02.cpp spareparts BOOK: Ivor Horton's Beginning Visual C++ 2005 1 February 19th, 2008 07:15 PM
EX9_21 Stack.h, page 551 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 July 10th, 2006 05:22 AM
EX7_13.cpp, Page 369 Nick Y BOOK: Ivor Horton's Beginning Visual C++ 2005 0 June 9th, 2006 05:41 AM
visual cpp tanay Visual C++ 0 May 19th, 2005 08:00 AM
visual cpp tanay Visual C++ 0 May 19th, 2005 07:47 AM





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