Initialize typedef struct

Viewed 26031

Why does this work:

struct person {
    char name[50];
    short mental_age;
} p1 = {"Donald", 4};

But not this:

typedef struct {
    char name[50];
    short mental_age;
} PERSON p1 = {"Donald", 4};

Is there a way that I can make a typedef struct and initialize Donald when I define this struct?

2 Answers
Related