1.结构体数组的定义
类型 变量名[常量表达式];
// 定义结构体类习性 struct stStudent{ int Age; int Level; } // 定义结构体变量 struct stStudent st; // 定义结构体数组 struct stStudent arr[10] 或者 stStudent arr[10]
2.结构体数组的初始化
struct stStudent{ int Age; int Level; } struct stStudent arr[5]={{0,0},{1,1},{2,2,},{3,3,},{4,4}} // 或者 arr[0].Age=100; arr[0].Level=100;
3.结构体成员的使用
格式:
结构体数组名[下标].成员名——arr[1].Age