There are 2 classes, A and B:
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
What I don't understand is that why forward declare class B in FileA.h? Seems FileA.h already included FileB.h.