⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 ch11_8.c

📁 C语言程序设计上机指导与练习 冶金工业出版社 刘怀亮
💻 C
字号:
/*CH11_8*/
/*用结构体变量作函数参数*/
#include"stdio.h"  
#include<string.h>
struct student
{
   int num;
   char name[20];
   float score[3];
};
main()
{
   void output(struct student);
   struct student boy;                 	/*定义结构体变量*/
   boy.num=110;
   strcpy(boy.name,"xiao ming");
   boy.score[0]=75.2;
   boy.score[1]=83.4;
   boy.score[2]=90.6;
   output(boy);                         /*结构体变量作函数的实参*/
}
void output(struct student stu)       	/*函数形参也是结构体变量*/
{
   printf("%d\n%s\n%f\n%f\n%f\n",stu.num,stu.name,stu.score[0],stu.score[1], stu.score[2]);
  printf("\n");
}


⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -