Chapter - 5: Classes in C++

If there are four objects used in a program how many this pointer would exist for these objects and why?


D
Sections
6
Exercises

A

B

C

D

1

2

3

4

5

6

No matter how many the objects are, there always one this pointer. It will point to the object that accesses the class members, and when another object access the class,  it simply points to that object, without being created separated for the second object. Another reason is, that no two objects can call a member function at the same time.


© 2020 Garbage Valuegarbage value logo