定义结构体数组
# include <stdio.h>//引用函数库
# include <stdlib.h>
struct info{
char name[20];
int age;
}student2[10];//定义结构体数组的第一种方式
void main(){
struct info student1[10];//定义结构体数组的第二种方式
}
初始化结构体
struct info{
char name[4];
int age;
}student1[2]={{"wang",18},{"li",17}},//初始化方式一
student2[2]={"wang",18,"li",17};//初始化方式二
struct {
char name[4];
int age;
}student3[2]={{"wang",18},{"li",17}},//初始化方式一
student4[2]={"wang",18,"li",17};//匿名结构体,初始化方式二无效