Mutual include statements between two .h files
Posted on 2004-10-11
I have two .H files, one class in each
B is defined and has a variable of type A *
which means that B has an include "A.h"
now, I have a situation that calls for A to know B as well
meaning that A will have a B * variabile
and will also need to include "B.h"
thats mutual include
when compiling B.h, the complier will not continue reading the include A.h after the point that include "B.h" appears in A.h
and therefore B has no idea who is A
what can I do to have both "know" each other and escape the compiler error.
btw, each .h file has a ifdef clause
using MS Visual Studio.NET 2003,