Wrox Programmer Forums
|
BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5
This is the forum to discuss the Wrox book Ivor Horton's Beginning Visual C++ 2008 by Ivor Horton; ISBN: 9780470225905
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Ivor Horton's Beginning Visual C++ 2008 ISBN: 978-0-470-22590-5 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 16th, 2010, 04:55 PM
Authorized User
 
Join Date: Jan 2010
Posts: 27
Thanks: 2
Thanked 0 Times in 0 Posts
Red face mistype in chapter 4 pg 203

the string identifier LENGTH is undercase when it is called in strcpy_s.
I don't think this is a big deal so I wonder why I posted it. At least you
know what chapter im on now. and yes ive resorted to typing in some of the example to keep track of the information. The whole idea of pointers not being initialized scares me, so I want to avoid this at all costs.

Code:
const size_t LENGTH = 22;
	const char source [LENGTH] = "the more the merrier!";
	char destination [LENGTH];
	cout << "The destination string is: " << strcpy_s(destination, source) << endl;

	errno_t error2 = strcpy_s(destination, length, source);

	if(error == EINVAL)
		cout << "Error. The source or destination is NULL." << endl;
	else if(error == ERANGE)
		cout << "Error. the destination is too small." << endl;
	else 
		cout << "The destination string is: " << destination << endl;





Similar Threads
Thread Thread Starter Forum Replies Last Post
Chapter 2, pg 39 [email protected] BOOK: Beginning PHP 6, Apache, MySQL 6 Web Development ISBN: 9780470391143 2 April 21st, 2009 01:42 AM
Chapter 3 pg 95 al2000 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 August 4th, 2008 09:18 PM
chapter 5, pg 154 spizotfl BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 3 May 1st, 2007 03:08 PM
Vsiual studio 98 to 203.net [email protected] C++ Programming 1 March 2nd, 2007 02:04 PM
Chapter 4 pg 131 cpkaiser BOOK: Beginning PHP, Apache, MySQL Web Development ISBN: 978-0-7645-5744-6 3 May 2nd, 2004 01:50 PM





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