# include <stdio.h>
struct Student
{
char name;
int age;
char sex;
};
int main(void)
{
struct Student stu1 = {'x', 18, 'n'};
struct Student * stu2 = &stu1;
printf("%d\n", stu2->age);//指针变量指向结构体变量中的成员
printf("%d\n", stu1.age);
return 0;
}
结构体定义
最新推荐文章于 2024-07-23 18:13:14 发布