Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
Commit608e4c65ec65b389324a83820fc1d70db5a7d96f (patch)
Author
 Angel Dimitriev <achi_d@abv.bg>
2021-03-21 18:28:52 -0400
Committer
 GitHub <noreply@github.com>
2021-03-21 18:28:52 -0400
Files200bf2d36e2c6273ce9c4a7feeb9cfd9ef26ed8f
Object-oriented_programming_FMI-608e4c65ec65b389324a83820fc1d70db5a7d96f.tar
Object-oriented_programming_FMI-608e4c65ec65b389324a83820fc1d70db5a7d96f.tar.gz
Object-oriented_programming_FMI-608e4c65ec65b389324a83820fc1d70db5a7d96f.zip
Parent097fba114ab09c0e3b30e85c633d380f66f4f10c (diff)
Update README.md
1 files changed, 2 insertions, 0 deletions
-rw-r--r--Sem. 04/README.md2
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));