ofstream outfile("book.dat",ios::out);
ofstreamoutfile("book.dat",ios::out);if(!outfile){cerr<<"openerror!"<<endl;exit(1);}f...
ofstream outfile("book.dat",ios::out);
if(!outfile)
{cerr<<"open error!"<<endl;
exit(1);}
for(i=0;i<k-1;i++)
{outfile<<book[i].num<<" ";outfile<<book[i].name<<" ";outfile<<book[i].author<<" ";
outfile<<book[i].press<<" ";outfile<<book[i].date<<" ";outfile<<book[i].amount<<" "<<endl;}
outfile.close();
}
if (j==0) {cout<<endl<<" 没有该书信息!!!"<<endl<<endl;
infile.close();};求注释 本人菜鸟 这都是什么意思啊 展开
if(!outfile)
{cerr<<"open error!"<<endl;
exit(1);}
for(i=0;i<k-1;i++)
{outfile<<book[i].num<<" ";outfile<<book[i].name<<" ";outfile<<book[i].author<<" ";
outfile<<book[i].press<<" ";outfile<<book[i].date<<" ";outfile<<book[i].amount<<" "<<endl;}
outfile.close();
}
if (j==0) {cout<<endl<<" 没有该书信息!!!"<<endl<<endl;
infile.close();};求注释 本人菜鸟 这都是什么意思啊 展开
若以下回答无法解决问题,邀请你更新回答
推荐律师服务:
若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询