class A
{
class B;
B::data myData; //Error: incomplete type not allowed.
class B
{
public:
struct data
{
int number;
};
};
};
In the code above, how could I declare a member variable of type data in class A?
Bmust be defined before you use it in the declaration ofA::myData: