Home > Back-end >  . I want to put the student data in TXT read this list, why always display error?
. I want to put the student data in TXT read this list, why always display error?

Time:10-04

Student * readfile (Student * head)
{
Ifstream infile "student. TXT", the ios: : (in);
if (! Infile)
{
Cout & lt; <"Open the address book failure" & lt; exit(1);
}
Head1, Student * * head2;
The head=new Student;
Head1=head;
while (! Infile. Eof ())
{
Infile & gt;> Head1 - & gt; The Name;

Infile & gt;> Head1 - & gt; Stunum;
Head2=head1;
Head1=new Student;
Head2 - & gt; Next=head1;

}
Head1 - & gt; Next=NULL;
Student * head3=head;
While (head3!=NULL)
{
Cout & lt; Cout & lt; Head3=head3 - & gt; Next;
}
Return the head;
}

. I want to put the student data in TXT read this list, why always display error?
  • Related