第五章结构体与共用体.pptVIP

  • 4
  • 0
  • 约3.83千字
  • 约 30页
  • 2017-04-28 发布于四川
  • 举报
第五章结构体与共用体

第5章 结构体与共用体;*;*;struct student { int num; char name[20]; char sex; int age; float score; char address[50]; };;先声明结构体类型再定义结构体变量 struct student { int num; char name[20]; char sex; int age; float score; char address[50]; }; struct student stu1,stu2; ;声明结构体类型的同时定义结构体变量 struct student { int num; char name[20]; char sex; int age; float score; char address[50]; }stu1,stu2; ;直接定义结构体变量 struct { int num; char name[20]; char sex; int age; float score; char address[50]; } stu1,stu2; ;说明: 类型与变量名是不同的概念; 对结构体的成员的使用与普通变量类似; 结构体的成员也可以是另一个结构体; struct student { int n

文档评论(0)

1亿VIP精品文档

相关文档