case 'q' : case 'Q' : cout << "Computing your totals" << endl; break; default : cout << "Invalid choice!"; } } /* This is where it should break out of but it is not */ // while (choice != 'Q' || choice != 'q'); - this is what I was using while ( choice != 'Q' ) cout << "\n\nCUSTOMER BILL\n"; cout << "-------------\n"; cout << "Name:\t" << name << endl; cout << "Phone:\t" << phone << endl; cout << "Email:\t" << email << endl << endl;
I have a menu that is using switch, when you enter q or Q you need to exit the loop (do while) and then start printing the info. I can not get the program to exit. I was using the
while (choice != 'Q' || choice != 'q'); at first, but it will never exit. How do I exit this using the while ( xxxxx ) code? Any hints, I need to use both cases of Q to test.
edit: let me know if you need to see the entire code, this is for a project at school, and I do have all the code except for this working.
Edited by Dani: Formatting fixed