I have:
struct date { int day; int month; int year; }; struct person { char name[25]; struct date birthday; }; struct date d = { 1, 1, 1990 };
Initialization with
struct person p1 = { "John Doe", { 1, 1, 1990 }};
work.
But if I try
struct person p2 = { "Jane Doe", d};
I get an error message:
"Date cannot be converted to int."
What's wrong? d is the date of the structure, and the second parameter should also be the structure. So that should work. Thank you and welcome
c struct
knowledge
source share