CameraIcon
CameraIcon
SearchIcon
MyQuestionIcon
MyQuestionIcon
9
You visited us 9 times! Enjoying our articles? Unlock Full Access!
Question

______ is a pointer to the current object. It is passed implicity to an overloaded operator ?

A
This
Right on! Give the BNAT exam to get a 100% scholarship for BYJUS courses
B
New
No worries! We‘ve got your back. Try BYJU‘S free classes today!
C
Scope
No worries! We‘ve got your back. Try BYJU‘S free classes today!
D
Private
No worries! We‘ve got your back. Try BYJU‘S free classes today!
Open in App
Solution

The correct option is A This

This is a pointer to the current object. It is passed implicitly to an overloaded operator.

Use of this pointer:-

The this keyword is used to represent an object that invokes the member function. It points to the object for which this function was called. It is automatically passed to a member function when it is called.

When a member function is called, it is automatically passed an implicit argument that is a pointer to the invoking objects. This pointer is known as 'this' pointer. It is internally created at the time of function call.

Operator overloading:-

Operator overloading is a specific case of polymorphism, where different operators have different implementations depending on their arguments.


flag
Suggest Corrections
thumbs-up
0
Join BYJU'S Learning Program
similar_icon
Related Videos
thumbnail
lock
Logic Gates
PHYSICS
Watch in App
Join BYJU'S Learning Program
CrossIcon