Typedef
typedef
is used to define types.
typedef struct {
int r;
int g;
int b;
} Color; // (1)!
typedef int Number; // (2)!
- Uses a
struct
[^1] to defineColor
. - Uses an
int
to defineNumber
.
References
- Read more about structs.
typedef
is used to define types.
typedef struct {
int r;
int g;
int b;
} Color; // (1)!
typedef int Number; // (2)!
struct
[^1] to define Color
.int
to define Number
.