@ -174,7 +174,39 @@ Book* AddBook(Book* book1)
return;
}
//C5
Book* DealoldBook(Book* book1)
{
Book* book = book1;
Book* prev = book1;
printf("输入要处理旧书的编号:");
int id;
scanf("%d", &id);
getchar();
while (book != NULL)
if (id == book->iNum)
if (book1 == book)
book = book->next;
free(prev);
return book;
prev->next = book->next;
free(book); // free():释放资源
printf("已将旧书处理掉!\n");
printf("按任意键返回\n");
return book1;
prev = book;
printf("没有找到该图书\n");
//C6
//C7