Now you can Subscribe using RSS

Submit your Email

Learn To (Do) This pointer in cpp Like A Professional

A LIFE ABK




c/c++ program solver,c++ program, new program, program code ,programing question

this pointer in cpp,advantage of this pointer in c++



In this example, we will explain to you how to use this pointer in c++. To understand this topic it is necessary to have basic knowledge of C++. Please read this article carefully so that you can understand this pointer in c++.


This pointer and advantage of this pointer in c++

  • Every object is a special pointer "this"  which points to the object itself. 

  • this is a local object pointer in every instance member function containing the address of the caller object.

  • this pointer access all member functions of the class but this pointer not to access static member functions of the class.

  • this pointer can not be modified.

  • It is used to refer caller object in the member function.

  • this is a keyword.

  • Friend functions do not have this pointer, because friends are not members of a class. Only member functions have this pointer.

  • This pointer resolves the name conflict problem in a class.




Look take an example






this pointer in c++,advantage of this pointer in c++, output screen


😊

Now next you are, write your code in the comment below. 😊

A LIFE ABK / Author & Editor

0 Comments:

Post a Comment

Please do not enter any spam link in the comment box.

Coprights @ 2021-2022, Ancient Code Designed By AbK