结构体指针定义及使用

#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);
}

猜你喜欢

转载自www.cnblogs.com/sunnybowen/p/8973040.html