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 March 10th, 2007, 01:19 PM
Authorized User
 
Join Date: Dec 2006
Posts: 36
Thanks: 0
Thanked 0 Times in 0 Posts
Default return *this - Chap 8 pg 418

in "Overloading the Assignment Operator" page 418 at the bottom, the example member function returns "* this".

At the top of pg 419, Ivor says that we return a reference with this statement.

I'm a little confused. My understanding is that "this" is a pointer (to the object calling the function). So, if I use, "* this" am I de-referencing the this pointer, and therefore passing an "object" back?

VC++ help document, http://ms-help://MS.VSCC.v80/MS.MSDN...7fad90791f.htm
says
The expression *this is commonly used to return the current object from a member function:

Code:
return *this;



Sincerely,
Brian
__________________
Sincerely,
Brian





Similar Threads
Thread Thread Starter Forum Replies Last Post
Exercises Chap 2 Ex 1 jimhpower BOOK: Beginning JavaServer Pages 0 March 9th, 2008 07:19 AM
Chap 1: page33 ed123 BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 1 January 4th, 2008 01:14 PM
Problems with Chap. 17 pg.557 & 558 alk BOOK: Beginning Visual Basic 2005 ISBN: 978-0-7645-7401-6 2 August 19th, 2007 09:58 AM
MySQL Fatal Error Chap 3, Pg 96-96 joshkosmala BOOK: Beginning PHP5, Apache, and MySQL Web Development ISBN: 978-0-7645-7966-0 2 January 8th, 2007 01:55 PM
Can't build on Chap 4 stzd8 BOOK: ASP.NET 2.0 Website Programming Problem Design Solution ISBN: 978-0-7645-8464-0 0 November 7th, 2006 10:33 PM





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