#include <stdio.h>
struct people
{ char studycard[20];
char name[20];
int age;
};
int main()
{
struct people a = { "2022060724","张三",19 };
struct people* pb = &a;
printf("%s\n", pb->studycard);
/*printf("%s\n", (*pb).studycard);
printf("%s\n", (*pb).name);
a.age = 20;
printf("%d\n", (pb).age);效果相同*/
printf("%s\n", pb->name);
a.age = 20;
printf("%d\n", pb->age);
return 0;
}
标签:20,struct,people,age,练习,pb,printf,指针,结构 From: https://blog.51cto.com/u_16336886/8133053