第九章系统安全性 struct date i int year int month int day struct student 1 f long int num char name [20 1 char seX struct date birthda struct studentI ps
第九章 系 统 安 全 性 struct date { int year; int month; int day; }; struct student1 { long int num; char name[20]; char sex; struct date birthday; struct studentl *ps; };
第九章系统安全性 913结构体型变量的定义 形式一,类型、变量分别定义: struct staff char name[20];/*姓名* char department[20];/*部门* Int salary /*工资* int cost /*扣款* Int realsum; /*实发工资* struct staff worker 1, worker 2
第九章 系 统 安 全 性 9.1.3 结构体型变量的定义 形式一, 类型、 变量分别定义: struct staff { char name[20]; /* 姓名 */ char department[20]; /* 部门 */ int salary; /* 工资 */ int cost; /* 扣款 */ int realsum; /* 实发工资 */ }; struct staff worker1, worker2;
第九章系统安全性 形式二,类型、变量一起定义: struct staff i char name [20] char department [20] int salar Int cost int realsum 3 worker1, worker 2
第九章 系 统 安 全 性 形式二, 类型、 变量一起定义: struct staff { char name[20]; char department[20]; int salary; int cost; int realsum; } worker1, worker2;
第九章系统安全性 形式三是形式二的简化,省略类型名: struct i char name [20] char department [20 Int salary; Int cost int realsum 3 workerI, worker
第九章 系 统 安 全 性 形式三是形式二的简化, 省略类型名: struct { char name[20]; char department[20]; int salary; int cost; int realsum; } worker1, worker2;
第九章系统安全性 worker char name [20] char department[20] Int salary int cost int realsum &worker char name [20] char department[20] int salary Int cost int realsum 图9绩构体型变量在内存中的存贮形式签密
第九章 系 统 安 全 性 图 9.1 结构体型变量在内存中的存贮形式