Stuck with getline problem

I really need help from you!! PLEASE!!

I use struct, ofstream, dynamic memory allocation
to get result in text file with this format : 1997 titanic; Cameron

BUT when i'd run this program,
In console : Year : 1997(I typed)
title : director : Cameron(I typed)

So I have no idea why title I can't put the value



[code]
cout<<"Year : ";
cin>>movie[i].year;
fout<<movie[i].year<<" ";

cout<<"title : ";
cin.getline(movie[i].title,MAX);
fout<<movie[i].title;

cout<<"director :";
cin.getline(movie[i].director,MAX);
fout<<movie[i].director<<endl;
1
2
cin >> movie[i].year;
cin.ignore(); //to discard the end of line 
Topic archived. No new replies allowed.