Struct declaration NOT sufficient?

Having the following C code: struct Point2_s; struct Point1_s{ int x; int y; Point2_s P2; } Point1; struct Point2_s{ int x; int y; } ; int main() { … return 0; } I’m getting an error: unknown type name ‘Point2_s’ Can anyone can please explain me WHY it doesn’t work? Why doesn’t the struct Point2_s… Read More Struct declaration NOT sufficient?

C: "array type has incomplete element type" when using array of struct without typedef

Problem: The following code snippet compiles well (where both struct types are typedefed): typedef struct { int a; float b; } member_struct; typedef struct { int a; double b; member_struct c; } outside_struct; outside_struct my_struct_array[4]; However, if the typedef of the "outside_struct" is dropped: typedef struct { int a; float b; } member_struct; struct {… Read More C: "array type has incomplete element type" when using array of struct without typedef