Is this not allowed or did I do something wrong? Please help!
For now, I'm just trying to read the moviedescription from the file "inmoviedata.txt." The first 8 lines contain the name of 8 movies which I am trying to output to the display screen via the for() loop at the bottom of my code below. Instead of declaring each movie and other characteristics of the movie line by line using dot notation, I was wondering if it's okay to use an array
and for loop like I've trying to do.
Trying to read the first 8 lines from a file which contains a movie
using namespace std;
ifstream inmoviedata; //file containg movie data
inmoviedata.open("moviedata.txt"); //opening the file with movie data
//omitting  because all movies in the database are in color
getline(inmoviedata,nameofmovie[i]);//'nameofmovie' undeclared, why?