next up previous
Next: Functions Up: Control Structures Previous: while

switch


char ch;
cin >> ch;
switch (ch) {
    case 'l':
       cout << "List of Records";
       printListOfRecords();
       break;
    case 'h':
    case '?':
       printHelpScreen();
       break;
    default:
       cout << "Invalid input!";
}


Andreas Koeller
2000-06-04