From 1057f545f48ee211de20e21083040bc37faf8d06 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E5=AD=99=E8=89=BA=E5=93=B2?= <446062334@qq.com> Date: Thu, 27 Apr 2023 17:48:29 +0800 Subject: [PATCH] read --- Bookread.svg | 184 +++++++++++++++++++++++++++++++++++++++++++++++++++ README.md | 2 +- 2 files changed, 185 insertions(+), 1 deletion(-) create mode 100644 Bookread.svg diff --git a/Bookread.svg b/Bookread.svg new file mode 100644 index 0000000..38cb431 --- /dev/null +++ b/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) + + + + + diff --git a/README.md b/README.md index 17b148d..33b8f78 100644 --- a/README.md +++ b/README.md @@ -704,4 +704,4 @@ C9:void returnBook(Reader* reader, Book* book);\\读者还书 C10:void save(Book* book);\\文件保存 ![000](save.svg) C11:Book* read1();\\从文件读取 - +![111](Bookread.svg)