πŸ“Š C++
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
πŸ’¬ Discuss
βœ… Correct Answer: (C) Use the pointer “this”

Explanation: 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.

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.

πŸ’¬ Discussion


πŸ“Š Question Analytics

πŸ‘οΈ
253
Total Visits
πŸ“½οΈ
4 y ago
Published
πŸŽ–οΈ
Dharmendra Sir
Publisher
πŸ“ˆ
91%
Success Rate