struct student
{int name;
int age;
}student;
typedef struct student* Pstu;
void main()
{
int a[2]={15,16};
printf("%d",((Pstu)a)->name);
printf("%d",((Pstu)a)->age);
}
结果:
还可以写成:
struct stu
{
int name;
int age;
};
void main()
{
//stu p;
int a[2]={15,16};
printf("%d",((struct stu *)a)->name);
printf("%d",((struct stu *) a)->age);
}
还可以写成:
typedef struct stu
{
int name;
int age;
}p;
void main()
{