#include<iostream>
#include<Windows.h>
#include<string.h>
#include<stdlib.h>
using namespace std;
struct _friend {
char name[32];
char sex; //m 男、f 女
int age;
};
int main()
{
struct _friend girl = { "小龙女",'f',18 };
struct _friend*my_girl = &girl;
cout << "小龙女的姓名:" << girl.name << "小龙女的性别:"
<< girl.sex << "年龄:" << girl.age << endl;
//通过指针访问
//方法一:直接解引
cout << "小龙女的姓名:" << (*my_girl).name<<endl;
//方法二:直接使用指针访问
cout << "小龙女的姓名:" << my_girl->name << endl;
system("pause");
return 0;
}