allbook.cpp
来自「图书馆管理系统 包括界面、书籍管理、会员管理等内容」· C++ 代码 · 共 38 行
CPP
38 行
/*************Function To Display All Details Of All Books ******************/
# include"liba.h"
void allbook()
{
struct book B;
int x;
FILE *fb;
fb=fopen("E:\\cpp\\book.dat","r");
rewind(fb);
window(1,1,80,2);
textbackground(LIGHTGRAY);
clrscr();
textcolor(YELLOW);
gotoxy(30,1);
cprintf("List Of All Books");
window(1,2,80,25);
textcolor(WHITE);
textbackground(BLUE);
clrscr();
printf("|----------|-------------------|--------------|-------------------|-------|");
printf("\n| Book Id | Book Name | Author Name |Publisher's Name | Price |");
printf("\n|----------|-------------------|--------------|-------------------|-------|");
while(fread(&B,sizeof(B),1,fb)==1)
{
if(x==23)
{printf("\nPress any key to continue!");getch();}
printf("\n|%4d%3d%3d|",B.b.bno,B.b.gno,B.b.no);
printf("%-19s|%-14s|%-19s| %4f |",B.bname,B.author,B.pub,B.price);
x=wherey();
}
printf("\n|----------|-------------------|--------------|-------------------|-------|\n");
textcolor(RED);
cprintf("press any key to return");
getch();
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?