Why does it 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 create a typedef structure and initialize Donald when I define this structure?
c struct
Goldi
source share