Suppose I want something of this sort, in one .cpp
source file:
class A {
public:
void doSomething(B *b) {};
};
class B {
publi
forward declare one class before other with
class B;
or
class A;
But still you won't be able to implement
void doSomething(B *b)
using only forward declaration of B. So you have to put definition of doSomething below full class A declaration
Add another declaration of B before A:
class B;
class A {
public:
void doSomething(B *b) {};
};
class B {
public:
void doSomething(A *a) {};
};