Website Summary Files Commits Branches @commit @diff @stats
diff options
context:
space:
mode:
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));