不懂,求解~

求助:不懂,求解~~
就是读4个文本里的信息,构成一条异质链表,便于后续的检索处理:

错误在while语句中,因为把while语句注释掉就运行成功,否则编译器在输入数据后就运行停止工作,奇怪的是:运行时,我并没有调用这个建立异质链表的函数,只是调用了其他录入信息的函数,就算这段代码出错,至少也应该在运行这段代码时才会出现,怎么也会有影响呢?????
(注:定义了4各类,类成员是7个成员函数,由抽象类派生,建立异质链表时定义的是抽象类指针)
#include"header.h"
InformationBase* Creative()
{
extern const char* filename1;
extern const char* filename2;
extern const char* filename3;
extern const char* filename4;
fstream ioff1,ioff2,ioff3,ioff4;
char s[80];
InformationBase *Record,*InfBaseHead=NULL,*p;
  char *Nam=new char[100];
char *Year=new char[10];
char *Month=new char[10];
char *Day=new char[10];
  char *Phone=new char[30];
char *mail=new char[30];
char *Calling=new char[30];
ioff1.open(filename1,ios::out|ios::in);
if(!ioff1)
{cerr<<"The file1 could not be open!\n";abort();}
ioff1.getline(s,80);
while(ioff1>>Nam>>Year>>Month>>Day>>Phone>>mail>>Calling)
{
Record=new RelativeAddress(Nam,Year,Month,Day,Phone,mail,Calling);
if(InfBaseHead==NULL)InfBaseHead=Record;
else
{
if(p==NULL)p=Record;
else p->next=Record;
}
p=Record;
}
p->next=NULL;
delete Record;
ioff1.close();
ioff2.open(filename2,ios::out|ios::in);
if(!ioff2)
{cerr<<"The file2 could not be open!\n";abort();}
ioff2.getline(s,80);
while(ioff2>>Nam>>Year>>Month>>Day>>Phone>>mail>>Calling)
{
Record=new RelativeAddress(Nam,Year,Month,Day,Phone,mail,Calling);
if(InfBaseHead==NULL)InfBaseHead=Record;
else  
{
if(p==NULL)p=Record;
else p->next=Record;
}
p=Record;
}
p->next=NULL;
delete Record;
ioff2.close();
ioff3.open(filename3,ios::out|ios::in);
if(!ioff3)
{cerr<<"The file3 could not be open!\n";abort();}
ioff3.getline(s,80);
while(ioff3>>Nam>>Year>>Month>>Day>>Phone>>mail>>Calling)
{
Record=new RelativeAddress(Nam,Year,Month,Day,Phone,mail,Calling);
if(InfBaseHead==NULL)InfBaseHead=Record;
else  
{
if(p==NULL) p=Record;
else p->next=Record;
}
p=Record;
}
p->next=NULL;
delete Record;
ioff3.close();
ioff4.open(filename4,ios::out|ios::in);
if(!ioff4)
{cerr<<"The file could not be open!\n";abort();}
ioff4.getline(s,80);
while(ioff4>>Nam>>Year>>Month>>Day>>Phone>>mail>>Calling)
{
Record=new RelativeAddress(Nam,Year,Month,Day,Phone,mail,Calling);
if(InfBaseHead==NULL)InfBaseHead=Record;
else  
{
if(p==NULL)p=Record;
else p->next=Record;
}
p=Record;
}
p->next=NULL;
delete Record;
return InfBaseHead;
}

------解决方案--------------------
代码调试首推单步
------解决方案--------------------
“VC调试(TC或BC用TD调试)时按Alt+8、Alt+6和Alt+5,打开汇编窗口、内存窗口和寄存器窗口看每句C对应的汇编、单步执行并观察相应内存和寄存器变化,这样过一遍不就啥都明白了吗。
(Linux或Unix下可以在用GDB调试时,看每句C对应的汇编并单步执行观察相应内存和寄存器变化。)
------解决方案--------------------
“VC调试(TC或BC用TD调试)时按Alt+8、Alt+6和Alt+5,打开汇编窗口、内存窗口和寄存器窗口看每句C对应的汇编、单步执行并观察相应内存和寄存器变化,这样过一遍不就啥都明白了吗。
(Linux或Unix下可以在用GDB调试时,看每句C对应的汇编并单步执行观察相应内存和寄存器变化。)