作业帮 > 综合 > 作业

c++ 定义一个结构类型,想在一个函数中返回两个不同的指针就是说head head1 ,代码如下,主函数该怎样?

来源:学生作业帮 编辑:作业帮 分类:综合作业 时间:2024/05/24 04:32:17
c++ 定义一个结构类型,想在一个函数中返回两个不同的指针就是说head head1 ,代码如下,主函数该怎样?
employee *delcre(employee * head,employee * head1){
employee *p,*s,*q;
p=head;
while(head->age>55&&head->sex=='m'||head->age>60&&head->sex=='w'){
if(head1==NULL){head1=head;q=head;}
else {q->next=p;q=p;}
head=head->next;
p=head;
coutsex=='m'||p->age>60&&p->sex=='w'){
if(head1==NULL){head1=p;q=p;}
else {q->next=p;q=p;}
s->next=p->next;
p=s->next;
cout
main函数自己写吧
#include
#include
using namespace std;
class Person
{
public:
Person()
{
name = new char[10];
sex = new char[6];
num = new char[20];
birthday = new char[8];
}