R
royend
Hi.
I am having trouble with the definition of my two structs in C++. Both
have functions depending on each other, which means none of them can
be declared before the other. How may I solve this?
A quick example:
struct structA{
int x;
void functionA(structB);
}
struct structB{
int y;
void functionB(structA);
}
This produces an error for structA, because it is missing a
declaration of structB. But, declaring structB before structA, just
turns the problem around as structB then will be missing a declaration
of structA...
Do you know of any possible solutions?
I am having trouble with the definition of my two structs in C++. Both
have functions depending on each other, which means none of them can
be declared before the other. How may I solve this?
A quick example:
struct structA{
int x;
void functionA(structB);
}
struct structB{
int y;
void functionB(structA);
}
This produces an error for structA, because it is missing a
declaration of structB. But, declaring structB before structA, just
turns the problem around as structB then will be missing a declaration
of structA...
Do you know of any possible solutions?