Google News
logo
CPP - Quiz(MCQ)
Why this pointer is used in C++?
A)
To access objects of other class
B)
To access objects of other variables
C)
To access all the data stored under that class
D)
To access the members of a class which have the same name as local variables in that scope

Correct Answer :   To access the members of a class which have the same name as local variables in that scope


Explanation : this pointer is used to access the members of a class which have the same name as local variables in that part of the code.

Advertisement