Structure pointer definition and use

#include<stdio.h>
struct student{
   int num;
   char name[20];
   float score;
};
 int main(void){
   struct student s1={20,"bowen",89.0},*sp;
   //struct stduent *sp;
   sp=&s1;
   printf("%d %s %f",sp->num,sp->name,sp->score);
}

 

Guess you like

Origin http://43.154.161.224:23101/article/api/json?id=325056393&siteId=291194637