There are 2 classes, A and B:
What I don't understand is that why forward declare class B in FileA.h? Seems FileA.h already included FileB.h.Code:--------------------------------- FileA.h --------------------------------- #include <FileB.h> class B; //Why forward declaration here class A{ ... B objB; ... }; --------------------------------- FileA.cc --------------------------------- #include <FileA.h> ...implementation of class A... --------------------------------- FileB.h --------------------------------- class A; // I understand this is forward declaration class B{ ... A objA; ... }; --------------------------------- FileB.cc --------------------------------- ...Implementation of class B



LinkBack URL
About LinkBacks


