Okay, so I am making a project where a user inputs a different variable to change, delete, print, or add to an array. When they type a q, the program quits. My problem is that when they type two of the same character (say p then another p after the if executes) the array does not print out the second, third.....billionth time. What is the issue here? (I haven't added any other selections yet because I still need to figure out the algorithms for those.)
Code:cout << "Please enter a selection. \nTo print the array, type P.\n"; cout << "To change a test score in the array, type C.\n"; cout << "To add a student to the array, type A.\n"; cout << "To delete a student from the array, type D.\n"; cout << "To quit, type Q. \nPlease enter selection now: "; cin >> selection; while (selection != 'q' || selection != 'Q') { if (selection == 'p' || selection == 'P') { cout << setw(8) << "Name" << setw(15) << "ID" << setw(20) << "Score\n\n"; for (counter = 0; inFile >> studentList[counter].Name >> studentList[counter].ID >> studentList[counter].score; counter++) { cout << setw(8) << studentList[counter].Name << "\t"; cout << setw(8) << studentList[counter].ID << "\t"; cout << setw(8) << studentList[counter].score << "\t" << endl; } } cout << "Please enter a selection. \nTo print the array, type P.\n"; cout << "To change a test score in the array, type C.\n"; cout << "To add a student to the array, type A.\n"; cout << "To delete a student from the array, type D.\n"; cout << "To quit, type Q. \nPlease enter selection now: "; cin >> selection; }