bobby98762001
Programmer
I want to create two classes that contain member functions where each meber function references the other class
eg
#include "A.h"
Class A{
private:
int a;
public:
void func(B b){};
}
#include "B.h"
Class B{
private:
int b;
public:
void func(A a){};
}
I know something is needed to reference each other but i don't know what it is...can anyone help me. in the header files i also use #ifndef etc to avoid the same header file being added more than once.
what do i have to do to allow me to reference as shown above
eg
#include "A.h"
Class A{
private:
int a;
public:
void func(B b){};
}
#include "B.h"
Class B{
private:
int b;
public:
void func(A a){};
}
I know something is needed to reference each other but i don't know what it is...can anyone help me. in the header files i also use #ifndef etc to avoid the same header file being added more than once.
what do i have to do to allow me to reference as shown above