This Pointer-Asked in Interviews.

Placewit
2 min readJan 13, 2022

Which of the following is true about this pointer?

A) It is passed as a hidden argument to all function calls

B) It is passed as a hidden argument to all non-static function calls

C) It is passed as a hidden argument to all static functions

D) None of the above.

Solution: B is correct

The ‘this’ pointer is passed as a hidden argument to all non-static member function calls and is available as a local variable within the body of all non-static functions. ‘this’ pointer is a constant pointer that holds the memory address of the current object. ‘this’ pointer is not available in static member functions as static member functions can be called without any object (with class name).

Thanks for Reading

Placewit grows the best engineers by providing an interactive classroom experience and by helping them develop their skills and get placed in amazing companies.

Learn more at Placewit. Follow us on Instagram and Facebook for daily learning.

--

--