结构体(struct)是由一系列具有相同类型或者不同类型的数据构成的数据集合,叫做结构体。结构体可以实现一些复杂的数据结构。
结构体的定义:struct为结构体定义的关键字,student为结构体的名字,char name[];int num;int age;为结构体成员。stu1,stu2为结构体变量。
struct student
{
char name [];
int num;
int name;
}stu1,stu2;
结构体(struct)是由一系列具有相同类型或者不同类型的数据构成的数据集合,叫做结构体。结构体可以实现一些复杂的数据结构。
结构体的定义:struct为结构体定义的关键字,student为结构体的名字,char name[];int num;int age;为结构体成员。stu1,stu2为结构体变量。
struct student
{
char name [];
int num;
int name;
}stu1,stu2;