The “this pointer” is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have this pointer. When a nonstatic member function is called for an object, the address of the object is passed as a hidden argument to the function.
An object’s this pointer isn’t part of the object itself. It’s not reflected in the result of a sizeof statement on the object.
Note: The friend functions also do not have this pointer, because friends are not members of a class.
Answer:
The “this pointer” is a pointer accessible only within the member functions of a class, struct, or union type. It points to the object for which the member function is called. Static member functions do not have this pointer. When a nonstatic member function is called for an object, the address of the object is passed as a hidden argument to the function.
An object’s this pointer isn’t part of the object itself. It’s not reflected in the result of a sizeof statement on the object.
Note: The friend functions also do not have this pointer, because friends are not members of a class.
need an explanation for this answer? contact us directly to get an explanation for this answer