The structure can be arranged. The method is similar to the current.
The following are examples of declaring the array of the structure variable with ten elements in the student type.
The usage is also quite the same as a current array.student data[10];
How to use other points are also ..current array.. similar.data[1].year = 3; strcpy(data[1].name,"MARIO");
[ Another writing ]
If the array of structures is used, writing other than explaining in the preceding clause can be done.
That is, the following three becomes the same meanings.
This writing can be used even by the structure pointer variable that is not the array.(*data).year data->year data[0].year
However, both stopping is safer because it is troublesome.
By the way, to explain this three are quite the same meanings
It is necessary to understand the mechanism of the structure and the pointer firmly.
should? question your teacher and superior,
It cannot explain this and for a moment.
Though it is possible to pass to the function by making the structure array an argument
In the received function, it is possible to treat as well as the argument of the current array.
Only the specified number displays contents of the student type in the following function.
In this case, it becomes similar behavior to time when the array was passed.void student_print(student data[],int count) { int i; for (i = 0;i < count;i++) { printf("[学年]:%d\n",data[i].year); Printf ("[ Class ]: %d\n" data[i].clas); Printf ("[ Attendance number ]: %d\n" data[i].number); Printf ("[ Name ]: %s\n" data[i].name); Printf ("[ Height ]: %f\n" data[i].stature); Printf ("[ Weight ]: %f\n" data[i].weight); } return; }