如何删除用单链表保存在文本的数据?

怎么删除用单链表保存在文本的数据???
用单链表保存在文本里的数据,在Delete()函数中删除,不知道怎么删除不了,郁闷
希望路过的帮帮我......谢谢!
[code=C/C++][/code]
#include <iostream>
#include <string>
#include <fstream>
using namespace std;
struct PhoneMessage //数据类
{
char name[10]; //姓名
char lPhoneNumber[15]; //长号
char sPhoneNumber[10]; //短号
char idNumber[20]; //身份证号
string email; //邮箱地址
PhoneMessage *next;

void Input(); //输入信息
void Display(); //输出信息
void ReadFile(istream &infile); //从文本中读出数据
};

class PhoneFunction //功能类
{
public:
PhoneFunction(); //构造函数
// ~PhoneFunction();
void Insert(); //插入信息
void Show(); //显示全部人的电话信息
void Save(); //保存数据
PhoneMessage *Find(char *); //查找
void Delete(char *); //删除
private:
PhoneMessage *head,*rear;
ifstream infile;
ofstream outfile;
};

void PhoneMessage::Input()
{
cout<<"请输入姓名:";
cin>>name;
cout<<"请输入电话号码(长号):";
cin>>lPhoneNumber;
cout<<"请输入电话号码(短号):";
cin>>sPhoneNumber;
cout<<"请输入身份证号码:";
cin>>idNumber;
cout<<"请输入邮箱地址:";
cin>>email;
}

void PhoneMessage::Display()
{
cout<<"姓名:"<<name<<'\t'<<"长号:"<<lPhoneNumber<<'\t'
<<"短号:"<<sPhoneNumber<<'\t'<<"身份证号码:"<<idNumber
<<'\t'<<"电子邮箱地址:"<<email<<endl;
}


void PhoneMessage::ReadFile(istream &infile)
{

infile>>name>>lPhoneNumber>>sPhoneNumber>>idNumber>>email;
}

PhoneFunction::PhoneFunction()
{
head=new PhoneMessage; //生成头结点
head->next=new PhoneMessage;
rear=head->next;

infile.open("PhoneMessage.text");
if(!infile)
cout<<"电话号码系统中没有任何号码,请输入号码!"<<endl;
else
{
while(!infile.eof())
{
rear->ReadFile(infile);
rear->next=new PhoneMessage;
rear=rear->next;
}
infile.close();
cout<<"读取电话号码成功!"<<endl;
}
}

void PhoneFunction::Insert() //尾插法插入数据
{
PhoneMessage *s;
string st="yes";
while(st=="yes")  
{
s=new PhoneMessage; //生成新结点
rear->Input();  
rear->next=s; //新结点插入到表尾
rear=s; //尾指针rear指向新的表尾
cout<<"是否继续输入(yes/no)......";
cin>>st;
}
rear->next=NULL; //尾结点后继指针置空

}

void PhoneFunction::Show()
{
for(PhoneMessage *p=head->next;p!=rear;p=p->next)
p->Display();
}

void PhoneFunction::Save()
{
outfile.open("PhoneMessage.text");
for(PhoneMessage *p=head->next;p!=rear;p=p->next)
outfile<<p->name<<"\t"<<p->lPhoneNumber<<"\t"<<p->sPhoneNumber
<<"\t"<<p->idNumber<<"\t"<<p->email<<endl;
outfile.close();
cout<<"保存成功!"<<endl;
}


PhoneMessage *PhoneFunction::Find(char *n) //按姓名查找
{
PhoneMessage *p;
for(p=head->next;p!=NULL;p=p->next)
{
if(strcmp(p->name,n)==0)
{
p->Display();
return p;
}
}
if(p==NULL)  
cout<<"查无此人!"<<endl;

}

void PhoneFunction::Delete(char *n) //这函数出错了,不知道怎么改???