'this Pointer' in C++ Language (part 1)

'this Pointer' in C++ Language



First we will read the 'Object Pointer; :-


Lets see an example :


object pointer


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 :


https://www.blogger.com/blogger.g?blogID=8367687560589286958#editor/target=post;postID=207470125275583250


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

Popular posts from this blog

Notepad, Wordpad and Paint

HOW TO PASS CCC EXAM WITH ONE ATTEMPT (NIELIT)

Inheritance in C++ Language(part 1)