此处的代码用于创建学生成绩单项目。在尝试理解时,我们无法弄清楚以下代码的用途和功能:
File.read(reinterpret_cast<char *> (&st), sizeof(student));
int pos=(-1)*static_cast<int>(sizeof(st));
Run Code Online (Sandbox Code Playgroud)
File.read(reinterpret_cast<char *> (&st), sizeof(student));
if(st.retrollno()==n)
{
st.showdata();
cout<<"\n\nPlease Enter The New Details of student"<<endl;
st.getdata();
int pos=(-1)*static_cast<int>(sizeof(st));
File.seekp(pos,ios::cur);
File.write(reinterpret_cast<char *> (&st), sizeof(student));
cout<<"\n\n\t Record Updated";
found=true;
}
Run Code Online (Sandbox Code Playgroud)