View Single Post
pichlo's Avatar
Posts: 6,445 | Thanked: 20,981 times | Joined on Sep 2012 @ UK
#4
Your main problem is that your cin.get(); on line 110 reads the '\n' that was left over in the input buffer after cin >> again; on line 103. You can try replacing the loop around the line 110 with something like
Code:
    c = cin.get();
    if (c != '\n')
    {
        cin.unget();
    }
    while((c = cin.get()) != '\n')
    {
        setMovieName.push_back(c);
    }
Having done that, you can then refactor the whole thing using getline() instead of spelling out the loops manually.

I am also a bit perplexed by the way you calculate the average rating, but I leave that bit to your tutor

Lastly, your system("pause"); is not portable. But you probably already know that.
 

The Following 4 Users Say Thank You to pichlo For This Useful Post: