C++问题求助

[复制链接]
查看11 | 回复1 | 2011-7-22 11:06:36 | 显示全部楼层 |阅读模式
void book::del()
//删除函数
{
char a;
int b;
int e=0,j=0;
int c=0;
book bok[100],s;
do
{
cout>b;
ifstream f;
f.open("bok.txt",ios_base::in);
while(f.eof()==0)
{
f>>s.number>>s.name>>s.zuozhe>>s.jiage>>s.chubanshe;
if(b=s.number)
{
c=1;
}
else
{
bok[e].number=s.number;
bok[e].name=s.name;       
bok[e].zuozhe=s.zuozhe;       
bok[e].jiage=s.jiage;
bok[e].chubanshe=s.chubanshe;
e++;
}
}
if(c==0)
{
couta;
}
else
{
ofstream f1;
f1.open("bok.txt",ios_base::out);
for(j=0;j>bok[j].number>>bok[j].name>>bok[j].zuozhe>>bok[j].jiage>>bok[j].chubanshe;
}
coutb;ifstream f;f.open("bok.txt",ios_base::in);while(f.eof()==0){f>>s.number>>s.name>>s.zuozhe>>s.jiage>>s.chubanshe;if(b=s.number)
//这里少了个等号{c=1;...
回复

使用道具 举报

千问 | 2011-7-22 11:06:36 | 显示全部楼层
if(b=s.number){c=1;}没看完你全部代码,问题应该在这里吧。if(b==s.number){c=1;}...
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

主题

0

回帖

4882万

积分

论坛元老

Rank: 8Rank: 8

积分
48824836
热门排行