c语言复习pp一tc11.pptVIP

  • 1
  • 0
  • 约1.08万字
  • 约 52页
  • 2018-12-29 发布于福建
  • 举报
c语言复习pp一tc11

第十一章 结构体与共用体 11.1 概述 11.2 定义结构体的类型和定义结构体变量 11.3 结构体变量的引用 11.4 结构体变量的初始化 11.5 结构体数组 11.6 指向结构体数据的指针 11.6 用指针处理链表 #include stdio.h #include math.h struct student { long num; char name[20]; float score; }; main( ) { struct student *p, stu[3]; int i; float sum=0; …;} stu[0] stu[1] stu[2] 99001 Li Feng 89.5 99002 Wang Yi 70.5 99003 Zhao Hui 92.0 stu p 例:输入/输出三位学生基本情况,并计算平均成绩 2. 指向结构体数组的指针 p+1 p+2 注意:p定义指向结构体的指针,只能指向一个结构体型数据,不能指向结构体的成员。 #include stdio.h void main( ) { struct student *p, stu[3]; int i; float sum=0; for(i=0; i3; i++) /*输入所有数据*/ {

文档评论(0)

1亿VIP精品文档

相关文档