C++ this Keyword | Cpp

  c++

Email

#include<iostream>

using namespace std;

class Book{
private :
int age ;

public :

void namet(int iage)
{
this->age=iage;

}
void disp()
{
cout << this->age ;

}
};
int main()
{

Book anil;
anil.namet(555);
anil.disp();
return 0;
}

Spread the Code

Leave a Reply

avatar

This site uses Akismet to reduce spam. Learn how your comment data is processed.

  Subscribe  
Notify of