R
Ronnie
Please look at the code below,
class BaseCol
{
public:
virtual void a() { cout << "BaseCol::a" << endl; }
virtual void b() { cout << "BaseCol::b" << endl; }
};
class ChildCol1 : public BaseCol
{
public:
virtual void a() { cout << "ChildCol1::a" << endl; }
virtual void b() { cout << "ChildCol1::b" << endl; }
};
class ChildCol2 : public BaseCol
{
public:
virtual void a() { cout << "ChildCol2::a" << endl; }
virtual void b() { cout << "ChildCol2::b" << endl; }
};
class Row : public ChildCol1, public ChildCol2
{
public:
// i want to overide the b function of ChildCol1 only !!
void b() { cout << "Row1::b" << endl; }
};
Now,
In Row class, How do i tell the compiler that i want to overide for
example only the b() function of ChildCol1 base class (and leave the
implementation for this function from ChildCol2) ?
TNX,
Ronnie
class BaseCol
{
public:
virtual void a() { cout << "BaseCol::a" << endl; }
virtual void b() { cout << "BaseCol::b" << endl; }
};
class ChildCol1 : public BaseCol
{
public:
virtual void a() { cout << "ChildCol1::a" << endl; }
virtual void b() { cout << "ChildCol1::b" << endl; }
};
class ChildCol2 : public BaseCol
{
public:
virtual void a() { cout << "ChildCol2::a" << endl; }
virtual void b() { cout << "ChildCol2::b" << endl; }
};
class Row : public ChildCol1, public ChildCol2
{
public:
// i want to overide the b function of ChildCol1 only !!
void b() { cout << "Row1::b" << endl; }
};
Now,
In Row class, How do i tell the compiler that i want to overide for
example only the b() function of ChildCol1 base class (and leave the
implementation for this function from ChildCol2) ?
TNX,
Ronnie