struct student
{
//成员列表
string name;
int age;
int score;
};
int main()
{
//创建学生结构体变量
struct student stu = { "张三", 20, 100 };
//通过指针指向的结构体变量
struct student*p = &stu;
//通过结构体访问结构体变量中的数据,需要用到-> 实现数据修改操作
p->score = 88;
cout << "姓名:" << p->name << "年龄: " << p->age << "分数: " << p->score << endl;
system("pause");
return 0;
}