Array of structure

Array of structure: We can make the array of structure as it may be required where we have to enter large amount of data. For example if we want to enter the data for 50 students then it is very difficult to declare 50 structure variables. By using array of structure we can handle it easily.

      e.g:     

struct student

{

int roll_num;

char name[20]

} std[50];

And if we want to access these members then same procedure is follows as like in array.

  e.g:

struct student

{

int roll_num;

char name[20]

} ;

void main()

{

struct student student_data[3]={{1117,jatin sharma},{1144,alex},{1299,steffy}};

}

Posted in C

Leave a Reply

Your email address will not be published. Required fields are marked *