
38 Data Structures Using C
struct student stud1 = {“Sachin Kumar”, 101, 16, “CE_IV”};
struct student stud2;
/* assign stud1 to stud2 */
stud2 = stud1;
/* Display contents of stud2 */
printf (“\n The copied contents are....”);
printf (“\n Name: %s”, stud2.name);
printf (“\n Roll: %d”, stud2.roll);
printf (“\n Age : %d” , stud2.age);
printf (“\n class: %s”, stud2.class);
}
1.13.6 Nested Structures
Nested structures are structures as member of another structure. For instance, the date of birth (DOB)
is a structure within the structure of a student as shown in figure below. These typ