What is ‘this’ pointer?

Sharad Jaiswal
Sharad Jaiswal

Posted On: Feb 22, 2018

 

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

    Related Questions

    Please Login or Register to leave a response.

    Related Questions

    C++ Interview Questions

    Explain what is OOP?

    Object-oriented programming (OOP) is a type of computer programming, also more commonly known as software design, in wh..

    C++ Interview Questions

    What is the difference between #import and #include in C++?

    The statement #include is used in C++ to include the source file or import the header files containing definitions of f..

    C++ Interview Questions

    What are the vectors in C++?

    Vectors are a kind of data structure sequence containers, which represent arrays but can change in size. Just like arra..