Non-static function members of a class gain access to the calling object’s members by
a) pointer to the calling object that is implicitly provided by the compiler. The name of this pointer is this. Members are prefixed implicitly by this->, as in
this->membername
b) a variable called self that is an alias for the calling object. This self is used to access the members of the object.
c) There is no particular mechanism, the variables just know what the calling object is and automatically refer to the calling object.
d) None of the above.
a) pointer to the calling object that is implicitly provided by the compiler. The name of this pointer is this. Members are prefixed implicitly by this->, as in
this->membername
The “this” pointer is implicitly passed to every constructor, destructor and all other non-static member function. this-> is an automatic prefix that is applied to every member of the class in the definition of function members.
You might also like to view...
When you create a chart in Word, the data is actually manipulated in Access
Indicate whether the statement is true or false
A button that is used to turn a feature both on and off is called a(n) ________ button
A) toggle B) shortcut C) mini D) key