[数学]C语言_ch09_1_结构体.pptVIP

  • 11
  • 0
  • 约1.1万字
  • 约 50页
  • 2018-03-03 发布于浙江
  • 举报
[数学]C语言_ch09_1_结构体

* * 指向结构体的指针 struct point { int x; int y; }; struct point pt; /*定义结构体变量*/ struct point *ppt; /*定义结构体指针*/ ppt = pt; 怎样通过pt访问pt的成员? pt.x = 0; /*成员运算符*/ 怎样通过ppt访问pt的成员? (*ppt).x = 0; ppt-x = 0; /*指向运算符*/ 第二种更常用 * * 指向结构体数组的指针 * * 定义结构体数组: struct student { char stuID[20]; char stuName[20]; char stuGender[4]; struct date timeOfEnter; float scoreOS; float scoreEnglish; float scoreMath; float scoreDS; }; struct student stu[30]= { {20060101001,李思,男,{1999,12,20},90,83,72,82}, {20060101002,林越,男,{1999,07,06},78,92,88,78}, {20060101003,岳珊,女,{1999

文档评论(0)

1亿VIP精品文档

相关文档