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

前端 未结 3 2544
粉色の甜心
粉色の甜心 2021-02-20 18:17

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 = Paren         


        
3条回答
提交回复
热议问题