diff --git a/README.md b/README.md index b845ebf..65f8650 100644 --- a/README.md +++ b/README.md @@ -418,6 +418,6 @@ C9:Reader* LendBook(Reader* reader, Book* book);\\读者借书 C10:void returnBook(Reader* reader, Book* book);\\读者还书 ![C10](images/returnBook.svg) C11:void save(Book* book);\\文件保存 - +![C11](images/save.svg) C12:Book* read1();\\从文件读取 diff --git a/images/save.svg b/images/save.svg new file mode 100644 index 0000000..222824b --- /dev/null +++ b/images/save.svg @@ -0,0 +1,192 @@ + + + + + + + + + + + + + + 开始 + + + + + + 结束 + + + + + + + + + + + + + + + + + + + + + Book* pCur = book1 + + + + + + iCount = 0 + + + + + + + + + + + + + pCur == NULL + + + + + + 输出 ("\n 没有学生记录!\n") + + + + + + + + + + + + + + + + + + + + + + + (fp = fopen("book.txt", + "wb")) == NULL + + + + + + + + + + + 输出 ("创建文件失败!\n") + + + + + + + + getchar() + + + + + + + + exit(1) + + + + + + + + + + + + + + + + + + + + + + + + + + + fwrite(pCur, sizeof(Book), 1, + fp) + + + + + + pCur = pCur->next + + + + + + + pCur + + + + + + + + + + + + + 输出 "\n" + + + + + + 输出 + ("保存文件的数据数目为:% + d\n",iCount) + + + + + + + + fclose(fp) + + + + +