typedef

Creates an alias for an existing type, making code more readable and portable.

Syntax

c
typedef existing_type new_name;

Example

c
typedef unsigned long long uint64;
typedef struct {
  int x;
  int y;
} Point;

typedef int (*Comparator)(const void*, const void*);

Point p = {3, 4};
uint64 bigNum = 123456789ULL;