全文预览

C++程序-----图书馆管理系统

上传者:随心@流浪 |  格式:doc  |  页数:15 |  大小:0KB

文档介绍
k *e; int r=0; for (int i=0;i<=top;i++) if(strcmp(book[i].getcbsname(),a)==0 &&book[i].gettag()==0) {if(r==0)cout <<setw(6) <<" 编号"<<setw(18) <<"书名"<<setw(10)<<" 作者"<<setw(10)<<" 出版社"<< setw(10)<<" 存量"<<endl; e=&book[i];e->disp();r++; }if(r==0)return NULL; }void bookdata(); //图书库维护 void disp() {for (int i=0;i<=top;i++) if(book[i].gettag()==0) book[i].disp(); }~BDatabase() //析构函数,将 book[] 写到 book.txt 文件中{fstream file("book.txt",ios::out); for (int i=0;i<=top;i++) if(book[i].gettag()==0) file.write((char *)&book[i],sizeof(book[i])); file.close(); }};void BDatabase::bookdata() {char choice; char bname[40]; char auname[40]; ame[40]; char xgqr; int czbook; int bookid; int bookod; Book *b; while (choice!='0') {cout <<"\t\t\t 图书维护"<<endl<<endl; cout<<"\t\t\t1 新增\n\t\t\t2 更改\n\t\t\t3 删除\n\t\t\t4 查

收藏

分享

举报
下载此文档