When you have two classes that refer to each other, that won't work. Consider this:
This results in files #including each other, which would never end. One of them has to be forward declared, and then you move the #include to the .cpp file.Code://class1.h #include "class2.h" //end class1.h //class2.h #include "class1.h" //end class2.h