- When relation between array and structure is considered, there are two things to consider
-
- Array(s) as member of structure
- Array of structure
- consider the following structure definition
struct student
{
int rno;
char name[10];
int marks[3];
int tot;
};
It consist of 4 members: i)roll number, ii)name, iii)array of marks of three subjects i.e. marks[0] stores marks of subject-1, marks[1] stores marks of subject-2, marks[2] stores marks of subject-3, and iv)total
- Now suppose if we want to store result of 10 students, then array of structure variable is defined as follows:
struct student s[10];
