Hey guys i'm having a lil trouble with object serialization.
student * s = new student("Mike",200014);
ofstream ofs("student.dat",ios_base::out | ios_base::binary);
ofs.write((char*)&s,sizeof(s));
ofs.close();
If student was a class with attributes studentName:string
and studentNumber:int
would the above code write the object pointed by s to the file student.dat
?