this keyword usage
1 Answers
this keyword holds the address object by which the member function is invoked. It’s a hidden parameter for every nonstatic member function.
Mapping of class member functions in C++ vs normal functions in C
Customer class with data + operations  ==> struct Customer with only data void Customer::recharge(double amt); ==> recharge(Customer* this, double amt); void Customer::recharge(double amt) { balance += amt; } ==> voidrecharge(Customer* this, double amt) {  this->balance+=amt;  } c1.recharge(100); ==> recharge(&c1, 100);