G
Guest
Hi All,
I have a question regarding about inheritance and member of the class. For
example I have the class A and class B what is the situation that I need to
define class B is base class of class A or class B is member of class A like
below:
Scenario 1:
class A : public B
Scenario 2:
or
class A
{
private:
B myB;
......
}
or
Scenario 3
class A
{
public :
friend class B
.......
}
Please help me to understand what are different between 3 scenario.
Thanks in advance
JP
I have a question regarding about inheritance and member of the class. For
example I have the class A and class B what is the situation that I need to
define class B is base class of class A or class B is member of class A like
below:
Scenario 1:
class A : public B
Scenario 2:
or
class A
{
private:
B myB;
......
}
or
Scenario 3
class A
{
public :
friend class B
.......
}
Please help me to understand what are different between 3 scenario.
Thanks in advance
JP