I have a basic question that once bothered me.
When using a class in a class, I can determine the title of the class that I want to use in the header file. I saw two ways to do this and would like to know the difference between the two methods?
EX1
#include "ClassA.h" class ClassB { public: ClassB(); ~ClassB(); ClassA* a; }; #endif
ex2 Here is another way to do this. The ClassA header will be defined in the source ClassB file.
class ClassA; class ClassB { public: ClassB(); ~ClassB(); ClassA* a; }; #endif
What are the differences between these two methods?
source share