Structure types can be created using a typedef.
Syntax
typedef struct structTag {
type1 memberName1;
...
typen memberNamen;
} typeName;
Note
structTag is optionalCode example
// structure type to handle color values
typedef struct {
int red;
int green;
int blue;
} rgb;
If the typeName has already been defined, you can declare a variable of that type without the struct keyword:
Syntax
typeName variableName1, ..., variableNamen;
Code example
// structure type to handle color values
typedef struct {
int red;
int green;
int blue;
} rgb;
...
rgb color;