C/C++ Arena

Step 6 of 6

typedef

Writing struct Player everywhere gets old. typedef creates an alias:

typedef struct {
    double x, y;
} Vec2;

Vec2 pos = {1.5, -2.0};

Your turn: complete the typedef and write Vec2 add(Vec2 a, Vec2 b) returning the component-wise sum.

Previous: enum