chapter8c语言.pptVIP

  • 3
  • 0
  • 约1.52万字
  • 约 47页
  • 2018-02-17 发布于河南
  • 举报
chapter8c语言

struct Student HighestScore(struct Student * pstudent) { float maxscore=0, score; int maxno, i, j; for (j=0; jCLECTUREMEMBER; j++) maxscore += pstudent-Score[j]; maxno = 0; for (i=1; iSTUDENTMEMBER; i++) { score = 0; for (j=0; jCLECTUREMEMBER; j++) score += (pstudent+i)-Score[j]; if (maxscorescore) { maxscore = score; maxno = i; } } return (*(pstudent+maxno)); } 8.5 引用自身的结构 结构可以嵌套,即结构中可以包含结构体类型的成员。 【例】 struct Education { char major[20]; // 主修课程 char degree[20]; // 学位 }; struct Stu

文档评论(0)

1亿VIP精品文档

相关文档