typedef enum{
kCircle,
kRectangle,
kOblateSpheroid
} ShapeType;
typedef enum{
kRedColor,
kGreenColor,
kBlueColor
} ShapeColor;
typedef struct{
int x,y,width,height;
} ShapeRect;
typedef struct{
ShapeType type;
ShapeColor fillColor;
ShapeRect bounds;
} Shape;
ShapeRect rect0 = {0,0,10,30};
声明结构变量时,你可以一次性初始化该结构的所有元素。