0 votes 0 votes What is this pointer? and what is the use of this pointer? Programming in C pointers + – iarnav asked May 27, 2017 iarnav 382 views answer comment Share Follow See all 0 reply Please log in or register to add a comment.
Best answer 1 votes 1 votes The ‘this’ pointer is passed as a hidden argument to all nonstatic member function calls and is available as a local variable within the body of all nonstatic 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). For a class X, the type of this pointer is ‘X* const’. Also, if a member function of X is declared as const, then the type of this pointer is ‘const X *const’ http://www.geeksforgeeks.org/this-pointer-in-c/ pawan kumarln answered May 27, 2017 • selected Jun 2, 2017 by pawan kumarln pawan kumarln comment Share Follow See all 0 reply Please log in or register to add a comment.