Below is the code I have for doing this but something is really wrong .
Filenames is the container I am using.
Filename is a string.
void SaveFileName(){
ofstream out;
out.open("..\\..\\Bush Breakout 3D\\Exe\\Level\\filenames.txt",ios::out | ios::app | ios::binary);
// out.seekp(0,ios::end);
int size = Filenames.size();
for(int i = 0;i < size;++i){
out.write((char*)(&Filenames),sizeof(Filename));
Filenames.pop_back();
out.seekp(20,ios::cur);
}
out.close();
}
Also how would I read the file back in either to a char array or a to a list and just one of the filenames at a time.
Here is the code I have for the read operation.
int i = 20;
char IFilename[i];
in.open("Level\\filenames.txt",ios::binary);
in.seekg(0,ios::beg);
in.read((char*)IFilename,i*sizeof(char));
(*it).SetFileName(IFilename);
in.close();
for(i = 0;i<20;i++){
IFilename[i] = 0;
}
Thanks to anyone who will help me with this I have been working on this for quite a while googled my brains several times but can't seem to find anything that will help with it. Much thanks, Jody Bush