I have two classes in my sketch that are independent of each other (a serial output and an LCD display) A simplified structure of my code is as follows:
class A
{
public:
int x;
void afoo()
{
x=1;
}
void afoo2
{
x=ClassB.bfoo+1;
}
};
A ClassA;
class B
{
public:
int y;
void bfoo()
{
y=ClassA.afoo+2;
}
};
B ClassB;
However, if I don't comment out class afoo2
I get the following error:
exit status 1
'ClassB' was not declared in this scope
I'm guessing that this is because I haven't yet created B ClassB
while class is being defined. Is there a way I can do what I'm intending here?