V
vertigo
Hello
I have:
classA.h file:
#include "classB.h"
classA{
classB *ptr;
};
classA.c file:
#include "classA.h"
.......
classB.h file:
#include "classA.h"
classB{
classA *ptr;
}
classB.c file:
#include "classB.h"
.......
I compile classA.c and classB.c and later link all together.
My problem is that in this case there is redefinition of classA and
classB (because classA.h and classB.h files are included two times).
When i used in *.h files:
#ifndef XXX
#define XXX
......
#endif
*.h files are included once but i do not see their definitions and can
not compile (classB.h do not see definition for classA and classA.h do
not see definition for classB).
How can i solve this problem ?
Thanx
Michal
I have:
classA.h file:
#include "classB.h"
classA{
classB *ptr;
};
classA.c file:
#include "classA.h"
.......
classB.h file:
#include "classA.h"
classB{
classA *ptr;
}
classB.c file:
#include "classB.h"
.......
I compile classA.c and classB.c and later link all together.
My problem is that in this case there is redefinition of classA and
classB (because classA.h and classB.h files are included two times).
When i used in *.h files:
#ifndef XXX
#define XXX
......
#endif
*.h files are included once but i do not see their definitions and can
not compile (classB.h do not see definition for classA and classA.h do
not see definition for classB).
How can i solve this problem ?
Thanx
Michal