This is the correct part of the forum for such questions.
Do you want to do this with qt or just plain C++?
In Qt have a look at the following classes:
QFile, QDataStream