我要崩溃了……哪里的问题呀!!大侠们
void CreatStudentf(char *stu,int& i){
ofstream out(stu);
Student s[100];
i=0;
cout<<"是否继续插入学生信息(y//n)"<<endl;
char ch;
cin>>ch;
while(ch=='y')
{
s[i].setsname ();
s[i].setsnum ();
out.write ((char*)&s[i],sizeof(Student));
i++;
cout<<"是否继续插入学生信息(y//n)"<<endl;
cin>>ch;
}
out.close ();
}
一运行到最后的out.close()就会出现错误,运行不下去了……怎么回事。(编译没错)