定义结构体的时候关键字是struct,不可省略
创建结构体变量的时候,关键字struct可以省略
结构体变量引用操作符"."访问成员
方法1:创建结构体的同时创建变量
struct student
{
string name;
int age;
int score;
} s3;//s3就是结构体变量
方法2:
通过学生类型创建具体学生
student s2;
s2.name="张三“;
方法3:
直接创建变量,赋值
student s1={“张三”,15,100};
通过指针访问结构体变量
struct student s={"张三“,18,100};
struct student *p=&s;
利用->访问指针指向的内容,访问结构体的属性
p->name访问结构体成员