Sleep(3000);//删除吧!
student * Student_List::Load_StuList()
{
student *head=new student;
student *p=new student ,*q=head;
ifstream ifile("student.txt",ios_base::in|ios::binary);
//如果不行的话,建议存取都改成文本格式!
if(ifile)
{
while(!ifile.eof())
{
ifile>>p->id>>p->name>>p->sex>>p->dob>>p->specity
>>p->addr>>p->eng_score;
q->next=p;
q=p;
}
p->next=NULL;
q=head->next;//真正的头节点
delete head;//删除空数据的头节点
head=q; //重置头节点
ifile.close();
}
cout<<"取出成功!"<
}