# typedef — C Programming

Source: https://www.geekswithgeeks.com/en/c/c-typedef

> Give a type a shorter, custom name.

## A nickname for a type

`typedef` doesn't create a new type — it gives an existing one an alias, most often used to drop the repetitive `struct` keyword.

## Before and after

Now `Point` alone works as a type name, no `struct` prefix needed.

```c
typedef struct {
    int x;
    int y;
} Point;

int main(void) {
    Point p = {1, 2};
    printf("%d,%d\n", p.x, p.y);
    return 0;
}
```

Output:

```
1,2
```
