For the assignment, I need to declare several structures, no problem. They are declared as:
typedef struct struct1{ struct2* object; } typedef struct struct2{ struct1* object; }
Of course, this will give me an error since struct2 is not declared before struct1. So I tried to declare this in advance by setting
struct struct2;
up. However, this requires me to call the object inside the struct1 block as
typedef struct struct1{ struct struct2* obj; }
The functions of this structure will be used when using the parameters struct1 * and struct2 * and will be tested as such (including the constructor). Using the struct tag, as in the example above, will give me countless errors. Does anyone know how to fix this?
source share