【发布时间】:2015-02-19 00:11:31
【问题描述】:
我的作业有问题,希望能得到一些帮助。
我假设有两个结构,志愿者和雇员,以及一个以名字、姓氏、电话号码 + 志愿者或雇员作为结构的工会“人”。
我以前有过使用联合 + 结构的经验,但我想在联合中有更多信息。我想知道如何正确设置它,这就是我到目前为止所拥有的。
typedef struct volunteer{
int hours;
int tasksCompleted;
}student;
typedef struct employee{
float salary;
int serviceYears;
int level;
}employee;
typedef union person{
char firstName[20];
char familyName[20];
char telephoneNum[10];
//employee e;
//volunteer;
}person;
任何帮助都会很棒。这是我坚持的任务指令。
创建一个包含以下公共记录的人员记录:名字、姓氏和电话,以及志愿者和员工记录之间的结合。确保添加一个字段以区分员工或志愿者两种记录类型。
【问题讨论】:
-
阅读说明:
union between the volunteer and employee record -
任何自称有工会经验的人,然后工会的名字、姓氏和电话号码都应该审核他们的所有代码。