I am creating a function to enter movie scores 1-5 for reviewer[X] based on user input. I thought using a for loop after defining the row would work, but it seems that using cin causes the code to not run.
void enterRating(const int ary[][NUM_MOVIES]){
int reviewer,
number;
cout << "Pick a reviewer 1-"<< NUM_REVIEWERS << " to enter scores for" <<
NUM_MOVIES << "movies";
do{
cin >> reviewer;
}while(reviewer > 0 && reviewer <= NUM_REVIEWERS);
for (int counter = 0; counter < NUM_MOVIES; counter++)
{
cout << ary[reviewer][counter];
}
}
I'm expecting to be able to manually input an integer into each array, if someone could give a hint as to where my idiocy lies it would mean a lot. Thanks!
Aucun commentaire:
Enregistrer un commentaire