Including headers

closed account (o1vk4iN6)
Well I am having problems with definition two classes in separate files but still being able to use each other for example:

1
2
3
4
5
6
7
8
9
10
11
12
13
14

// a.h /////////////////////////////
#include "b.h"

class A {
   B* b;
};

// b.h /////////////////////////////
#include "a.h"

class B {
   A* foo();
};


Although this isn't possible since it creates an endless include.
Ironicaly, this is the exact same example I used in my article on this subject.

See sections 3 + 4:

http://www.cplusplus.com/forum/articles/10627/#msg49679
Topic archived. No new replies allowed.