#include<iostream>
using namespace std;
#include<string>//c++风格字符串所需头文件
struct student
{
string name;
int age;
int score;
};
int main()
{
student s={"张三",12,99};
student *p=&s;//注意结构体和数组不一样,需要写取地址符
cout<<"姓名:"<<p->name<<"年龄:"<<p->age<<"分数:"<<p->score<<end1;
system("pause");//暂停程序,等待用户按键
return 0;
}
//使用箭头