Input from file errors. Please help!

Class assignment (that I can no longer get credit for, but this is bugging me) takes input from a txt file, outputs to screen Artist Name, Artist Album, and average of 7 ratings through a function call. Besides the average function, there needs another function that takes input and adds the number of people who rated it a 1-5.

I get through extracting the first line from file and computing the average and outputs to the screen fine. The problem is with the second line of data. I have tried so many things (for 2 weeks) and still can't get this to work. Currently this is the output I get on the second line - -1.#IND.

Last edited on
your program only reads one line.

The problem lies somewhere between

while(!musRat.eof() && musRat)


void addRat(ifstream& in, Music& mus, int);

Sorry I can't tell you why but I feel the problem is with the 2 lines above.
Thanks SamuelAdams but I finally figured it out.
Topic archived. No new replies allowed.