Skip to content

Typedef

typedef is used to define types.

typedef struct {
    int r;
    int g;
    int b;
} Color; // (1)!

typedef int Number; // (2)!
  1. Uses a struct[^1] to define Color.
  2. Uses an int to define Number.

References

  1. Read more about structs.