Non-static function members of a class gain access to the calling object’s members by
a. 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)
Explanation: 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...
How many bytes does each use to represent a character?
What will be an ideal response?
Which of the following are C-string constants? Give the number of characters in each of these.
a. ‘\n’ b. ‘n’ c. “Lamb\n” d. “Mary” e. “M”
An ________ is a small specialized computer built into larger components such as automobiles and appliances
A) tablet B) embedded computer C) supercomputer D) mobile device
Logic bombs are a program that is set to execute their payload upon a certain condition being met
a. true b. false