D

Dharmendra Sir • 3.53K Points
Extraordinary

Q. How are objects self-referenced in a class member function?

  • (A) Use * with this object’s name
  • (B) Using the keyword “object”
  • (C) Use the pointer “this”
  • (D) By passing “self” as a parameter in the member function
  • Correct Answer - Option(C)
  • Views: 109
  • Filed under category C++

Explanation by: Dharmendra Sir
In classes, objects are self-referenced using “this” pointer inside member functions. e.g. this->val to access the data member of the current object.

You must be Logged in to update hint/solution

Discusssion

Login to discuss.

Be the first to start discuss.


Question analytics