C语言中的结构体数组。它定义了许多烦杂的数据内容。把许多数据集中在一起处理。这样容易管理繁杂的数据内容。
实例
小狗的 名字 颜色 体重 和年龄 统一管理
#include<stdio.h>
int main(){
struct dog
{
char name [20];
char color[10];
int weight;
int age;
}
stu1={"dog","yellow",60,3};
printf("%s %s %d %d\n",stu1.name,stu1.color,stu1.weight,stu1.age);
struct dog1
{
char name [20];
char color[10];
int weight;
int age;
};
struct dog1 stu2;
scanf("%s %s %d %d",&stu2.name,&stu2.color,&stu2.weight,&stu2.age);
printf("name:%s color:%s weight:%d age:%d\n",stu2.name,stu2.color,stu2.weight,stu2.age);
}