I read how this can be made to work using forward declarations.
class A
{
public:
B *objB;
void foo(){}
}
class B
{
public:
A *objA;
void foo(){}
}
Just wanted to confirm if this design is ever possible ?
class A
{
public:
B objB;
void foo(){}
}
class B
{
public:
A objA;
void foo(){}
}
PS: If someone could also please explain why/why not this is possible logically in terms of classes, rather than just in terms of language, like by quoting some example. What exactly this signify in terms of classes ?