From 608e4c65ec65b389324a83820fc1d70db5a7d96f Mon Sep 17 00:00:00 2001 From: Angel Dimitriev Date: Sun, 21 Mar 2021 18:28:52 -0400 Subject: Update README.md --- Sem. 04/README.md | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Sem. 04/README.md b/Sem. 04/README.md index 3933611..8974ae7 100644 --- a/Sem. 04/README.md +++ b/Sem. 04/README.md @@ -137,8 +137,10 @@ Student createStudent(const char* name, int fn, int gradesCount, double avGrade) void saveStudentToFile(ofstream& f, const Student& st) { size_t nameLen = strlen(st.name); + f.write((const char*)&nameLen, sizeof(nameLen)); //first we write the size of the name! f.write(st.name, nameLen); + f.write((const char*)&st.fn, sizeof(st.fn)); f.write((const char*)&st.gradesCount, sizeof(st.gradesCount)); f.write((const char*)&st.averageGrade, sizeof(st.averageGrade)); -- cgit v1.3.1-23-gd82d