/*look at nested structures i.e. structures that contain other structures */ #include #include int main (void) { /* define the type using the third method illustrated in struct.c */ typedef struct { char chrisname[30],surname[30]; struct { int day; int month; int year; } dob; } persondetails; /* this is a nested stucture because persondetails contains another structure dob within it */ persondetails p; /* variable declaration */ /* assign some values to the fields in variables */ strcpy(p.chrisname,"Santa"); strcpy(p.surname,"Claus"); /*assign to values to the fields within the nested structure */ p.dob.day = 25; p.dob.month = 12; p.dob.year = 1765; printf("%s %s was born on %i/%i/%i\n",p.chrisname,p.surname,p.dob.day,p.dob.month,p.dob.year); }