求改错 各位编程高手帮帮忙啊

来源:百度知道 编辑:UC知道 时间:2024/05/31 02:55:14
#include <iostream.h>
#include <cstring>
#include <stdio.h>
using namespace std;
//saving.h 定义类的头文件---用链表实现的
class Save;
class Person //声明一个结点类
{
friend Save;

char name[10]; //姓名
char number[30]; //身份证号
double money; //存款余额
Person *next;
};

class Save //声明一个存款管理类
{

Person *head; //指向头结点的指针
public:
Save()
{
head=0;
}

~Save();
Save& CreatePerson(void); //开户
bool DeletePerson(Person man); //销户
bool CheckIn(void); //存款
bool CheckOut(void); //取款
static int Select(void); //包含有四个选项---开户,销户,存款,取款
};
//saving.cpp ----类的实现
const int error=0;
const int True=1;
using namespace std;
Save::~Save()
{
Person *p=head->next;
while(head)
{
delete head;
head=p;
p=p->next;
}
}
Save& Save::CreatePerson(voi

基本上你的类里面的每个函数里面都有错误,我都给你改了。累死了,记着给分哦。下面代码,我在我这编译运行都通过的了。

#include <iostream.h>
#include <cstring>
#include <stdio.h>
using namespace std;
//saving.h 定义类的头文件---用链表实现的
class Save;
class Person //声明一个结点类
{
friend Save;

char name[10]; //姓名
char number[30]; //身份证号
double money; //存款余额
Person *next;
};

class Save //声明一个存款管理类
{

Person *head; //指向头结点的指针
public:
Save()
{
head=0;
}

~Save();
Save& CreatePerson(void); //开户
bool DeletePerson(void); //销户
bool CheckIn(void); //存款
bool CheckOut(void); //取款
static int Select(void); //包含有四个选项---开户,销户,存款,取款
};
//saving.cpp ----类的实现
const int error=0;
const int True=1;
using namespace std;
Save::~Save()
{
while(head != NULL)
{
Person *p = head;
head = hea