Asynchronous Activity: Nested Structures & Arrays of Structures
Output :
Enter student name: Emmara Grace Bello
Enter age: 19
Enter city: Masbate
Enter ZIP code: 5413
Student Information:
Name: Emmara Grace Bello
Age: 19
City: Masbate
ZIP Code: 5413
What is the purpose of using a nested structure in this program?
The purpose of this nested structure is to represent the address of a student, where the
address structure is defined inside the student structure. In which it allows to group the
related data members the city and zip code together, that’s making the code more
organized and easier to understand.
How is the nested structure accessed in the program?
To access the nested structure, we can use the dot notation. For example, to access the
city member of the Address structure, we use student, address, city. Similarly, to access
the zip Code member, we use student, address, zip Code.