4

Let us understand with an example how and where this pointer is used. class employee { unsigned int m_age; unsigned int m_salary; employee(unsigned int age, unsigned int salary) { m_age = age; // same as this->m_age = age; m_salary = salary; //same as this->m_salary = salary }void update(unsigned int age, unsigned int salary) { m_age = age; // same as this->m_age = age; m_salary = salary; //same as this->m_salary = salary }}; int main() { employee emp(40, 45000); emp.update(40,...

Read this post on allabouttechnologies.co.in


Karan Arora

blogs from Chandigarh