正在加载图片...
例1(1) #include <stdio. h> struct student [int num:/学号 char name[20]:姓名* char sex;/性别:m-男,f-女刘 float score[5]:成绩* float aver;/平均分* :/*定义结构体类型 struct studen↑,一般都定义为全局可用 的数据类型*/ pede struct student STU/为数据类型起别名*/ void maino t int i,j: float sum STU stul3o];供定义结构体变量*8 例1 (1) #include <stdio.h> struct student {int num; /* 学号 */ char name[20]; /* 姓名 */ char sex; /* 性别:m-男,f-女 */ float score[5]; /* 成绩 */ float aver; /* 平均分 */ }; /* 定义结构体类型 struct student ,一般都定义为全局可用 的数据类型*/ typedef struct student STU;/*为数据类型起别名*/ void main() { int i,j; float sum; STU stu[30];/* 定义结构体变量 */
<<向上翻页向下翻页>>
©2008-现在 cucdc.com 高等教育资讯网 版权所有