C++ Pointer To Object - InfoBrother114519
C++ Pointer To Object - InfoBrother114519
C++ Pointer To Object - InfoBrother114519
POINTER TO OBJECTS:
A Variable That Holds an Address value is called a Pointer
variable or simply pointer. We already discussed about
pointer that's point to Simple data types likes int, char,
float etc. So similar to these type of data type, Objects
can also have an address, so there is also a pointer that
can point to the address of an Object, This Pointer is
Known as This Pointer.
THIS POINTER:
Every Object in C++ has access to its own address
through an important pointer called T h i s Pointer. The
This Pointer is an implicit parameter to all member
functions. Therefore, inside a member function, this may
be used to refer to the invoking object. Whenever a
member function is called, it is automatically passed an
implicit arguments that is This pointer to the invoking
object (i.e. The object on which the function is invoked).
?
T h iTopic
The s pointer:is Introduction
passed as aTo "This"argument
hidden Pointer | Pointer
to all
Nonstatic member function calls and is available as a
local variable within the body of all Nonstatic functions.
T h i s Pointer is a constant pointer that holds the memory
address of the current object. T h i s pointer is not
available in static member functions as static member
functions can be called without any object (with class
name).
obj1.setx( 10 );
class_name * Object_pointer_name;
Date * ptr;
Check Output
Sardar Omar.
InfoBrother
Topic : Introduction To "This" Pointer | Pointer
ADVERTISING
OPEN
Get:More
Topic Tutorials To
Introduction for"This"
Free: Pointer | Pointer
ADVERTISEMENT
Meet Our Team Privacy Policy Term of Use
Topic : Introduction To "This" Pointer | Pointer
Write For Us FAQ Help Us Contact Us