Structures

Arrays of structures :

In previous posts, we have seen how to create structure variable. This variable holds one set of values. If we want to store more than one set of values into a structure variable then variable must be declared as array of structure. The syntax is shown below

struct struct-name struct-variablename[size];

Example:

struct Employee E[10];

Where 'E' is declared as array and contains 10 Employee details. E[0] is first employee, E[1] is second Employee, and so on.


Comments