码迷,mamicode.com
首页 > 其他好文 > 详细

语法*第九章*5 结构体指针作为函数参数

时间:2018-05-01 23:55:42      阅读:197      评论:0      收藏:0      [点我收藏+]

标签:str   core   float   code   nbsp   结构   pre   void   har   

#include<stdio.h>
struct student{
   int num;
   char name[20];
   float score;
} stu={112301,"bowen1",20};
void print(struct student *p);
 int main(void){
  print(&stu);
}
void print(struct student *p){
  printf("%d %s %0.1f",p->num,p->name,p->score);
}

 

语法*第九章*5 结构体指针作为函数参数

标签:str   core   float   code   nbsp   结构   pre   void   har   

原文地址:https://www.cnblogs.com/sunnybowen/p/8977099.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!