📄 allbook.cpp
字号:
/*************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 + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -