Hi there
Ihave this program that i enter certain ammount of movie names their directors and year made in three different arrays using cin.getline(stringname[],lengthsize,'\n').
The part of the code is as follows:
for(i=0;i<3;i++)
{
cout<<"Enter Movie: "<<i+1<<endl;
cin.getline(movie,50,'\n');
cout<<"Enter Director: "<<i+1<<endl;
cin.getline(director,50,'\n');
cout<<"Enter Year: "<<i+1<<endl;
cin.getline(year,50,'\n');
}
if(i==10)
cout<<"The list is full!"<<endl;
break;
The problem is that when I run the program it will go to "Enter Movie" (no cursor to enter the movie name)and goes right away to "Enter Director" when i = 0 only???
Ihave this program that i enter certain ammount of movie names their directors and year made in three different arrays using cin.getline(stringname[],lengthsize,'\n').
The part of the code is as follows:
for(i=0;i<3;i++)
{
cout<<"Enter Movie: "<<i+1<<endl;
cin.getline(movie,50,'\n');
cout<<"Enter Director: "<<i+1<<endl;
cin.getline(director,50,'\n');
cout<<"Enter Year: "<<i+1<<endl;
cin.getline(year,50,'\n');
}
if(i==10)
cout<<"The list is full!"<<endl;
break;
The problem is that when I run the program it will go to "Enter Movie" (no cursor to enter the movie name)and goes right away to "Enter Director" when i = 0 only???