|
|
|
@ -497,7 +497,7 @@ Reader* LendBook(Reader* reader1, Book* book1)
|
|
|
|
|
|
|
|
|
|
函数原形:void returnBook(Reader* reader, Book* book);
|
|
|
|
|
功能:接受两个形参:读者链表地址和图书链表地址,用读者的编号进行匹配,找到该读者后,用图书的编号进行匹配,进行还书,否则返回
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
void returnBook(Reader* reader1, Book* book1)
|
|
|
|
|
{
|
|
|
|
|
Reader* reader = reader1;
|
|
|
|
@ -550,7 +550,7 @@ void returnBook(Reader* reader1, Book* book1)
|
|
|
|
|
return reader1;
|
|
|
|
|
}
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -560,6 +560,7 @@ void returnBook(Reader* reader1, Book* book1)
|
|
|
|
|
|
|
|
|
|
1)函数原形: void save(Book* book);
|
|
|
|
|
2) 功能:接受一个形参:book的链表地址,新建一个文件,将链表中的信息保存到硬盘中
|
|
|
|
|
```
|
|
|
|
|
void save(Book* book1)
|
|
|
|
|
{
|
|
|
|
|
FILE* fp;
|
|
|
|
@ -589,7 +590,7 @@ void save(Book* book1)
|
|
|
|
|
printf("保存文件的数据数目为:%d\n", iCount);
|
|
|
|
|
fclose(fp);
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
@ -598,7 +599,7 @@ void save(Book* book1)
|
|
|
|
|
|
|
|
|
|
1)函数原形: Book* read1();
|
|
|
|
|
2) 功能:打开一个文件,将文件中的信息读取到内存中,并返回一个Book类型的指针
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
Book* read1()
|
|
|
|
|
{
|
|
|
|
|
FILE* fp;
|
|
|
|
@ -627,7 +628,7 @@ Book* read1()
|
|
|
|
|
return pHead;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
```
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|