我有两个结构:
struct B;
struct A {
B *b;
void Func() {
std::cout << b->x << std::endl;
}
};
struct B {
A a;
float x;
void Func() {
a.Func();
}
};
当我尝试编译它时,我收到以下错误:
Error C2027 use of undefined type 'B'
Error C2227 left of '->x' must point to class/struct/union/generic type
我该如何解决?