Getting this error:
error: field ‘circle’ has incomplete type
I get this error for all the shapes in my union; the code is as follows:
Code:
typedef struct circle {
/* add the missing fields */
float x, y;
long radius;
} CIRCLE;
struct geomObj {
union {
struct CIRCLE circle;
struct SQUARE square;
struct RECTANGLE rect;
struct TRIANGLE tri;
};
int id;
short type;
};
All my other structures are defined similar to CIRCLE, just with different variables and names. Just wondering what I'm doing wrong
Thanks in advance,