. :
class Class1;
class Class2
{
Class1* m_class1;
};
This allows Class2.h to use Class1 without having to include Class1.h in the header file. Of course, any .cpp file that includes Class2.h should also include Class1.h.
Just remember that you can declare types in several modules, but you can only define types in one of them.
source
share