it is a pointer accessible only in the member


It is a pointer accessible only in the member functions of a struct, class or union type. It points to the object for which the member function is called. Static member functions do not have this pointer. While a nonstatic member function is called for an object, the address of the object is passed out as a hidden argument to the function. For instance, the following function call

myDate.setMonth( 3 );

may be interpreted this way:

setMonth( &myDate, 3 );

The object's address is accessible from in the member function as the pointer. This is legal, by unnecessary, to use this pointer while referring to members of the class.

 

Request for Solution File

Ask an Expert for Answer!!
C/C++ Programming: it is a pointer accessible only in the member
Reference No:- TGS0211588

Expected delivery within 24 Hours