From 6327f1616bff641920a4d531226298924364d6a3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Sun, 21 May 2023 16:04:59 +0800 Subject: [PATCH] bookread --- README.md | 2 +- images/Bookread.svg | 184 ++++++++++++++++++++++++++++++++++++++++++++ 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 images/Bookread.svg diff --git a/README.md b/README.md index 65f8650..d44b52a 100644 --- a/README.md +++ b/README.md @@ -420,4 +420,4 @@ C10:void returnBook(Reader* reader, Book* book);\\读者还书 C11:void save(Book* book);\\文件保存 ![C11](images/save.svg) C12:Book* read1();\\从文件读取 - +![C12](images/Bookread.svg) diff --git a/images/Bookread.svg b/images/Bookread.svg new file mode 100644 index 0000000..38cb431 --- /dev/null +++ b/images/Bookread.svg @@ -0,0 +1,184 @@ + + + + + + + + + + + + + + Bookread + + + + + + 结束 + + + + + + + + + + + + + + + + + + + + + 阅读FILE + + + + + + Book pHead = NULL + + + + + + * pTemp = NULL + + + + + + *pTemp = NULL + + + + + + + + + + + + + fp = fopen() == NULL + + + + + + + + + 输出 + + + + + + + + exit() + + + + + + + + + + + + + + + + + pTemp = (Book*)malloc + (sizeof(Book)) + + + + + + + + + + + + + + + + + + + + !pHead + + + + + + pHead = pCur + + + + + + + + + pCur->next = pTemp + + + + + + pCur = pTemp + + + + + + + + + + + + + + + fread(pTemp, sizeof + (Book),1,fp) + + + + + + + + + + + + + + + fclose(fp) + + + + + -- 2.34.1