C++读写问题
不知道怎么用链表通过read()函数怎么调用,其中head是头指针
// 请把代码文本粘贴到下方(请勿用图片代替代码)
infile.open("student.txt",ios::in);
infile.read((char *)head,sizeof(student)); while(infile)
{
cout<<head->num<<"t"; cout<<head->name<<"t"; cout<<head->score<<endl; head=head->next; infile.read((char *)head,sizeof(student)); }
infile.close();
}
慕勒3428872