+1 vote
in C Plus Plus by

Which of the following is correct about this pointer in C++?
a) this pointer is passed as a hidden argument in all static variables of a class
b) this pointer is passed as a hidden argument in all the functions of a class
c) this pointer is passed as a hidden argument in all non-static functions of a class
d) this pointer is passed as a hidden argument in all static functions of a class

1 Answer

0 votes
by

Answer: c
Explanation: As static functions are a type of global function for a class so all the object shares the common instance of that static function whereas all the objects have there own instance for non-static functions and hence they are passed as a hidden argument in all the non-static members but not in static members.

Related questions

0 votes
asked Oct 19, 2022 in C Plus Plus by AdilsonLima
0 votes
asked Jan 6 in C Plus Plus by GeorgeBell
...