用户自己建立由不同类型数据组成的组合型数据结构,叫做结构体
定义形式
struct 结构体名
{
类型 变量或数组
…
}:
eg
struct stu
{
char*name;
int num;
int age;
float score;
};
struct stu stu1, stu2;
struct std
{
char*name;
int num;
int age;
float score;
}stu1={"Tom",12,18,136.5};
整体赋值只限定义结构体时
可以和数组结合用比如加上class[]
结构体指针
struct stul*p;
p=&stul;