If I understood your problem correctly, each line in the file has one attribute of the movie. Try using two for loops, first the main loop will count the number of movies. The second, inner, loop will read each line, parse it, and store the disered value.
So lets say we have 4 movies
will the code look like this?
1 2 3 4 5 6 7 8
for(int i =0 ; i<4;i++){
for(int i=0;i<4;i++){
getline(movies[i].title ,movies[i].rating , movies[i].actor , movies[i].director)
//Don't know how to use that so i dont think its correct ..
}
}
Well the problem is getline function takes 2 parameters the object and the variable and here its an array...
main problem is for example Movie1 name is The pursuit of happiness i must add it in notepad as ThePursuitOfHappiness i cant add spaces between the words or each word will be added in the array separately
main problem is for example Movie1 name is The pursuit of happiness i must add it in notepad as ThePursuitOfHappiness i cant add spaces between the words or each word will be added in the array separately