Wrox Programmer Forums

Need to download code?

View our list of code downloads.

| FAQ | Members List | Search | Today's Posts | Mark Forums Read
BOOK: Professional C++, 2nd Edition
This is the forum to discuss the Wrox book Professional C++, 2nd Edition by Marc Gregoire, Nicholas A. Solter, Scott J. Kleper ; ISBN: 978-1-1181-6995-7
Welcome to the p2p.wrox.com Forums.

You are currently viewing the BOOK: Professional C++, 2nd Edition 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 Search this Thread Display Modes
  #1 (permalink)  
Old March 3rd, 2012, 05:42 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default About code on page 182

Bonjour,
On the top of the page 182, in the fisrt code snippet, one of the line reads :

int getId() const;

I have issue with this specific line
Indeed I do not understand the use of "const" on this line
Could one of you help me understand the line (I may have missed one point somewhere)

Best regards, Philippe
  #2 (permalink)  
Old March 3rd, 2012, 06:05 PM
Registered User
Points: 11, Level: 1
Points: 11, Level: 1 Points: 11, Level: 1 Points: 11, Level: 1
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2012
Posts: 3
Thanks: 0
Thanked 1 Time in 1 Post
Default

Forget my question
I knew it was a bad idea

Const is there because getId is an Inspector
See p 33 for details if needed

Sorry for the post.
Regards, Philippe
  #3 (permalink)  
Old March 4th, 2012, 11:30 AM
Wrox Author
Points: 220, Level: 4
Points: 220, Level: 4 Points: 220, Level: 4 Points: 220, Level: 4
Activity: 0%
Activity: 0% Activity: 0% Activity: 0%
 
Join Date: Mar 2011
Posts: 49
Thanks: 0
Thanked 4 Times in 4 Posts
Default

Correct, getId() is an inspector and does not change any data members of the class, so it's const.
 


Thread Tools Search this Thread
Search this Thread:

Advanced Search
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
Code to save html page source code? Jaymond Flurrie Access VBA 2 July 2nd, 2019 06:04 PM
Chapter 5 Pages 182 to 183 Constructors epc BOOK: Beginning ASP.NET 3.5 : in C# and VB BOOK ISBN: 978-0-470-18759-3 1 October 2nd, 2009 02:39 PM
On page 182 tedr BOOK: ASP.NET 3.5 Enterprise Application Development with Visual Studio 2008: Problem Design Solutio 0 March 28th, 2009 07:19 PM
Master Page Method: Code-Behind for Content Page kwilliams ASP.NET 2.0 Professional 3 June 2nd, 2008 12:57 PM
Errata page 182 tpangborn BOOK: Ivor Horton's Beginning Visual C++ 2005 0 May 21st, 2006 09:19 PM



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


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