Suppose i have a header which contain these two classes
class A:public class B{
// code
};
class B
{
protected:
A a_object;
};
when the compiler compiles this include file,when it comes to Class A ,it sees class A inherits from B but it doesn't reach to Class B definition.So it gives an error. and if i reverse the order of both classes,it gives error due to a_object as it doesn't see Class A definition.
So how to solve this problem? and assume that i restricted to this include file to have class A and B definitions.
Thanks