'this Pointer' in C++ Language (part 1)
'this Pointer' in C++ Language
First we will read the 'Object Pointer; :-
Lets see an example :
In the quotation given above, we have created a class of box in which we've got three variables, length,breadth and height.
Output
Now we see how object pointer works.
A Pointer contains address of an object is called Object Pointer.
Here we see that the pointers pointing to the small box object.
Lets understand it through example :
In the quotation given above, we put the address of the smallbox object into pointer .i.e p=&smallBox; now *p will indicate object smallbox therefore We can write *p instead of objects. But remember, the object pointer indicate the function using arrow keys, as we are looking at the quotation above.
If this article is helpful to you then please like share and comments.. thank you..
Comments
Post a Comment