this Keyword in c++.
This video tutorial explains the " this " keyword in c++.
You will learn what is the use of this keyword, how to use this keyword in c++ in detail with example.
source code for this tutorial
#include <iostream>
using namespace std;
class Person{
private :
int age;
public:
void setAge(int age){
this->age = age;
}
void showAge(){
cout << this->age<<endl;
}
};
int main()
{
Person anil;
anil.setAge(24);
anil.showAge();
return 0; }