How to access parent class's data member from child class, when both parent and child have the same name for the dat member

Viewed 39437

my scenario is as follows::

class Parent
{
public:
int x;
}

class Child:public Parent
{
int x; // Same name as Parent's "x".

void Func()
{
   this.x = Parent::x;  // HOW should I access Parents "x".  
}
}

Here how to access Parent's "X" from a member function of Child.

3 Answers
Related