急啊 大家给看看哪里错了 怎么跳过语句啊
include <iostream>#include <fstream>
using namespace std;
struct Student1{
int num;
char name[32];
float fScore[3];
float fAverage;
};
int main(){
int i,j=0,d=0;
struct Student1 * stud1=new Student1;
ofstream output("c:/StudInfo.txt",ios::out);
output.unsetf(ios::skipws);
while(1)
{cout<<"input 0 Exit";
cin>>d;
cout<<"请输入基本信息 编号 姓名";
if(d==0)break;
j++;
cin>>stud1->num>>stud1->name;
cout<<"输入三科成绩";
for(i=0;i<3;i++)
{cin>>stud1->fScore[i];}
cin>>stud1->fAverage;
output.write((char *)stud1,sizeof(Student1));
}
ifstream input("c:/StudInfo.txt",ios::in);
input.unsetf(ios::skipws);
i=0;
while(i<j)
{i++;
input.read((char *)stud1,sizeof(stud1));
cout<<stud1->num<<ends<<stud1->name<<ends;
for(i=0;i<3;i++)
{cout<<stud1->fScore[i]<<ends;}
cout<<stud1->fAverage<<endl;
}
input.close(); output.close();
return 0;
}
cout<<"请输入基本信息 编号 姓名"; 这一句怎么不执行啊
if(d==0)break; 放在它下面也不行 大家给看看