Hello all,
First time user on this web forum, I'm having problems with this function I'm building
So I need to read in all the data for one movie from a text file that contains several movies
text file looks like this
7 8.9 1993 281646 D 195 Schindler's List
8 8.9 1957 122408 D 96 12 Angry Men
9 8.8 1975 219012 D 133 One Flew Over the Cuckoo's Nest
10 8.8 2008 474562 A 152 The Dark Knight
the function belongs to a class named MovieType
when i call the function in main, and i try to cout the first variable " rank" its giving me garbage..... any ideas?
bool MovieType::readMovieInfo(ifstream &movie)
{
bool endFile = false;
movie.open("movie.txt");
movie.ignore();
movie >> rank;
movie >> weight;
movie >> year;
movie >> votes;
movie >> genre;
movie >> length;
getline(movie, name);
if(endFile = true)
return endFile;
}
//