Answer the question
In order to leave comments, you need to log in
How to write custom class to qFile?
Using the usual C++ tools, a custom class can be written to a file with:
ofstream ofile("Student.dat", ios::binary);
ofile.write(reinterpret_cast<char*>(this), sizeof(Student));
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question