// example illustrating the syntax for accessing data in nested structures #include typedef struct date // making it a typedef { int month; int day; int year; } Date; // so that "Date" is the type name struct employee { char firstName[20]; char lastName[20]; Date hireDate; // using the typedef "Date" to declare Date birthDate; }; int main() { struct employee emp; // emp is an employee variable struct employee emp2 = { "John", "Smith", {6, 10, 2003}, {2, 19, 1981} }; // Set the name to "Alice Jones" strcpy(emp.firstName, "Alice"); strcpy(emp.lastName, "Jones"); // set the hire date to March 14, 2001 emp.hireDate.month = 3; emp.hireDate.day = 14; emp.hireDate.year = 2001; // sets the birth date to Sept 15, 1972 emp.birthDate.month = 9; emp.birthDate.day = 15; emp.birthDate.year = 1972; }