If you want to create files and write/read data, I would suggest you use the ifstream and ofstream functions. The good things with them is that you can write and read whole structures of data in one single call.
#include <fstream.h>
struct Test
{
public:
int iVar;
char cVar;
};
Test...