#include struct Student char name[20] float maino struct Student sa={"李飞",100},sb={"于凡",72.5} struct student*tp,s[3}={"宋石",93.5} s[1=sa /*结构体变量(整体)赋值* s[2]=sb /*结构体变量(整体)赋值* printf("s[0]: %s %f\n"s[O]- name, s[O]. score p=&s1l printf("s[1]: %s %fn", (p). name, ' p)score) p=&s[2 printf("s[2]: %s %f\n", p->name, p->score
#include struct Student { char name[20]; float score; }; main() { struct Student sa={"李飞",100},sb={"于凡",72.5}; struct Student *p,s[3]={"宋石",93.5}; s[1]=sa; /*结构体变量(整体)赋值*/ s[2]=sb; /*结构体变量(整体)赋值*/ printf("s[0]:%s %f\n",s[0].name,s[0].score); p=&s[1]; printf("s[1]:%s %f\n",(*p).name,(*p).score); p=&s[2]; printf("s[2]:%s %f\n",p->name,p->score); }