Can a class member object of parent class have reference of parent class
If there is class say Class A
class A
{
B* bObj;
}
class B
{
A* aObj
}
Is this valid?
Yes, you just need a forward reference to
B
:
1 2 3 4 5 6 7 8 9 10
|
class B;
class A
{
B* bObj;
}
class B
{
A* aObj
}
| |
Topic archived. No new replies allowed.