ofstream out("ttt.txt"); //output file;
class object[10]; // 10 objects;
for(int i=0;i<10;++i)
out<<object[i].mem1<<object[i]<<mem2<<...........;
out.close();
ifstream in("ttt.txt");
for(int j=0;j<10;++j);
in>>.................. //must have some functions to read the //private mem;