Hi,
I'm just trying to get two classes to succesfully be able to call functions within each others class. So I effectively have:
// in A's header file
class A {
public:
B *b;
void a_function(); // in this function, there's the line b->b_function2
void a_function2();
};
// in B's header file
class B {
public:
A *a;
void b_function(); // in this function, there's the line a->a_function2
void b_function2();
}; The problem I have at the moment is that I have to include in each header file, the other header file, which it doesn't like. I've also tried forward class definitions, but this doesn't work either, because the line class B; in A's header file isn't sufficient to tell A that B has a function called b_function2().
Any ideas? This has troubled me for a while and is a very difficult problem to google!!