Hello.
How to define structures before using them in each other.
main.cpp:
Compiling with command: g++ main.cppCode:#include <iostream>
using namespace std;
struct Struct2;
struct Struct1;
struct Struct2
{
Struct1 a;
}
struct Struct1
{
Struct2 b;
};
int main()
{
}
Errors:
main.cpp:10: error: field `a' has incomplete type
main.cpp:17: error: multiple types in one declaration
Thanks in advance.