|
-
October 17th, 2010, 01:50 PM
#1
Question on *this and const
Hey guys i'm new to the forum and c++ in general, and sorry if i'm posting in the wrong place but i'm a little hung up on question that was handed out a review session here is the question verbatim:
The expression *this refers to the object for which a member function is invoked. What is the type of this in a non-const member function of class X?
a) const X*
b) const X* const
c) X *const
d) X*
The answer was c), I thought I knew what the question was asking except that I thought c) and d) were both right answers. After I saw the correct answer I have no idea what the question means anymore, could someone explain why c) is right and d) is not, and the train of thought required to understand this question.
Tags for this Thread
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|