Is it possible to do a case within a case? For example:
I have actual things filled in, in the sub-cases, but it doesn't prompt me with a 2nd selection. It just skips to the "Invalid Input" portionCode:#include <cstdlib> #include <iostream> using namespace std; int main() { int y; int x; int a; int b; cout << "Selection:\n"; cout << "1. Start\n"; cout << "2. LoL\n"; cout << "3. Quit\n"; cout << "Please make your selection: "; cin >> y; switch (y) { case 1: switch (x) { case 1: break; case 2: break; case 3: break; case 4: break; default: cout << "Invalid input.\n"; break; } break; case 2: cout << "\nWrong Button!\n\n"; break; case 3: return 0; break; default: cout << "\nInvalid input.n\n"; } system("PAUSE"); }
Edit: Hope I indented it right. Feel free to yell at me if I didn't.
Edit Edit: A simple yes or no would suffice; however, if no a suggested alternative method would be extremely appreciated.