you'd have better luck using terminating characters instead of fixed-length arrays:
Code:
#include <iostream>
#include <fstream>
int main()
{
int film;
std::string title;
std::string director;
int pos;
int len;
std::fstream file("test.dat",std::ios::in);
while(file>>film)
{
file.ignore(32000,'\n');
getline(file,title,'/');
file.ignore(32000,'\n');
getline(file,director,'/');
file.ignore(32000,'\n');
file>>pos;
file.ignore(32000,'\n');
file>>len;
file.ignore(32000,'\n');
std::cout<<"-- Film "<<film<<" --"
<<"\nTitle:\t\t\t"<<title
<<"\nDirector:\t\t"<<director
<<"\nCurrent Position:\t"<<pos
<<"\nTotal Length:\t\t"<<len<<std::endl;
}
file.close();
file.clear();
return 0;
}
it is just simple file reading
edit: oh yeah, I copied that file you gave verbatim, so if those comments aren't in there, you may need to modify my method... or maybe not...yeah, you will.